And now UnitSaveOnExitUnmodified verifies that
we do not unnecessarily upload unmodified
documents because always-save-on-exit is set.
Always-save-on-exit is meaningful only when there
are modifications. Otherwise, we create identical
copies as separate revisions.
Change-Id: I933069d31d3d273c41734b58e0849680566e591a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This improves the flagging of possible-modification
in cases where there might be a race between the
arrival of the ModifiedStatus flag from Core
and the closing of the document. This can happen,
for example, when the user makes an edit and
immediately closes the document. In these cases
we want to be able to assume modification based
on the last activity from the user that may have
modified the document.
The issue this patch fixes is that we were too
aggressive in our assumption of modification,
because it was better to be wrong and try to
save rather than not. However, this also set
the IsModifiedByUser header to the PutFile
request when uploading the document to storage,
which was not accurate or acceptable.
Change-Id: I84228bfbb92f688d303568027171df3686d2cd2b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This tests the headers when always_save_on_exit
is set.
Change-Id: I1aa2d11db79f525f2d94ced8702514d5b3535fc8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This fixes the handling of the
always_save_on_exit=true setting.
Change-Id: I6993030c2af7fa080c8421c5cb4fa7cb9ea3eb9b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Improves stability by closing the document
only after uploading has finished.
Change-Id: I20927a5d009998d9d7a25c3309fef02a45077c70
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Forced uploading is used to overwrite the
file in storage. This is useful when there
is a conflict. Only the user can decide to
do (or not do) that. As such, no auto-save
or any other case should force an upload.
The issue is that we can clobber a conflicted
version in storage by accident. Forced upload
was used for always_exit_on_save=true setting,
which wasn't really needed as the feature isn't
to forcefully upload, rather to just save and
upload as necessary.
Change-Id: Ie46f38f76392493fe8f8112f05953899963da99b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We track the number of wopi requests done
during tests and compare with the expected,
in each test scenario. This ensures we don't
miss any expected/required wopi operation,
but also that we don't do more than the
necessary minimum.
Change-Id: I2474f54987a6a12c396b6c0566324772ee3300e6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Refactor UnitWOPIDocumentConflict.cpp into
WOPIUploadConflictCommon.hpp and reuse for both
DocumentConflict and SaveOnExit tests.
Change-Id: I54ec1e37e5e9c6298b12a2b2e596363683fb2e34
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>