And tile::needsFetch on that result will always return true given the
default of invalidFrom of 0 and the comparison of
return this.invalidFrom >= this.wireId || ...
so the tile return from the cache is unusable.
It is typical for a request not to have a wireId, if we don't use the
cache then doRender will send a timecombine result with wireIds set. But
if we use the cache here we send a response using the wireId of the
request.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I586406af86b0f503dfc204e20120cc8acebf5b8e
- controller used to send two messages first to save then
once saving is done migrate the document
- now controller only sends one message, COOL handles
unsaved document
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Id4afe1f9a04ef99005d7f0dbd6246826ba82442b
This stopped working well a long time ago, and is already disabled
on the coolwsd side, so dung out the rest of the code & docs on this.
Change-Id: I2e0b73fe9780e16c3cc74ae3a38ae6b04434717a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
UnitBase::isUnitTesting() and UnitWSD::isUnitTesting() to avoid
calling methods that crash on mobile.
Signed-off-by: Patrick Luby <plubius@neooffice.org>
Change-Id: Ie6bc2d238ac9e475b02ceef5809c55acc129dd52
Still needed to add a bunch of #if !MOBILAPP to disable all of the
Online server's unit testing classes so that the iOS app won't crash
when opening a document.
TODO: the iOS app will not accept text input at all. Is some code
unexpectedly consuming message data sent over the mobile fake socket?
Signed-off-by: Patrick Luby <plubius@neooffice.org>
Change-Id: Ie874ee8e452188a7b4cdf6d5f87708e5ed9b0235
Now StorageBase::getFileInfo() is strictly
used for reading.
Change-Id: I0d412e7ef6e502ae8b1864131b6f174e44343273
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This moves the logic to update the PostMessageOrigin
field in WOPIFileInfo to be done in the constructor.
And now getPostMessageOrigin() returns a const&.
Change-Id: I88936441edb58deb65d901db4baaf6311be3bdd1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This merges multiple implementations of
assertCorrectThread and simplifies its
usage.
Change-Id: I7be5dea62c6046fb0412d7f885fcbcc4b66e3fd9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
When we detect document change in storage, we have to
either prompt the user(s) to either reload from storage,
discarding their own changes, or force saving their
changes and clobber the version in storage.
However this implies that the loaded document was
modified. Because otherwise, we do reload the
document from storage, automatically.
This change improves the detection logic to take
into account not just the saved state of the
document, but also the upload state. That is,
if a previous modification was not uploaded yet,
then the user does have changes that they need to
consider to discard or save.
Change-Id: I5f03593bebc5b565fc19e78562896bcdcb6112e2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This corrects the ending of renaming by
moving that logic only after we get the
async upload results (either success,
failure, or timeout).
It also cleans up a few cases, such as
not needing to special case renaming with
identical names. This ensures that
subsequent attempts are not ignored.
Change-Id: Ib7a432d8a3b6ef5448291763cd31cc844c997e7e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Since we need both the PID of the kit process and
the document name, it's easier to construct the
quarantine instance only when we have downloaded
the document.
Change-Id: I8b537122c4b10ae6e822a82fa6a75456d0eaaaff
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Utility classes/functions should not re-implement
any logic external to their function. The
path to the file to be quarantined is controlled
by other bits and QuarantineUtil is simply told
to quarantine the given file.
Change-Id: Iab351ccbf78953bb63f18c451321d34fe61f59b5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
- previously we set the Modified state in admin panel only when
wsd successfully upload the document to storage
- modified state updation depends on core, it might happen that
uploading is already done and successfull but we didnot get
the modified state from the core which will show wrong modified
status in admin panel
Change-Id: I014a8f92753fc6a93b37921d0f3cdce390bef35e
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
We now track the storage attributes in three
distinct states. The first, when we issue an
uno:Save (called nextStorageAttrs), when we
get the save response (called
currentStorageAttrs), and when we upload
(called lastStorageAttrs).
What this does is allow us to separate the
attributes without clobbering them, while
supporting retrying when a failure accures.
Specifically, we shouldn't lose the
attributes of the latest save when the async
upload completes. Similarly, we should
preserve the last upload attributes when
the upload fails.
This approach improves reliability
significantly, as evidenced through the
new test, UnitSuperfluousSaves.
Capture the current storage attributes upon saving
Change-Id: I91756fda7b9ed5887dc4ed9691db536371b5bcad
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
A new field, called wasModified, is now published
in the uno:Save result. This gives us an accurate
state of the saved document, whether it had
user-modifications, or was an unconditional forced
save by the user.
Using this flag makes the IsUserModified header,
used during the storage PutFile request, much
more reliable.
Change-Id: I0b7e4421d4a42eef01e19be8d9ee0bee6bff9f03
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
It's easy to use keyboard shortcuts to issue
multiple saves within a short period of time,
which is hardly useful to make saves faster.
In fact, they'd make the server and document
slower by adding overhead.
Similarly, we could get autosave requests
on certain occassions (for example when
the last editor disconnects) while saving.
Again, there is no advantage in issuing
another save in that case. We re-evaluate
the save state when we get the save result.
Here we prevent issuing another save while
one is already in flight, regardless of the
reason.
Change-Id: I9503adabc3a9f1dc6cdbbcf93c5cccbc5414fcf3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The following commit caused a regression with
PDFs which are read-only, but may allow comments.
commit cca0a561ed
Author: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Date: Sun Jan 15 18:29:18 2023 -0500
wsd: never upload using a session that is read-only
Change-Id: I9bf1fde21b47a4f119b99cc58f76cd683c2152a9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The iOS app saves directly to local disk so, other than for
"view file extension" document types or other cases that
I am missing, we can assume the document is writable until
a write failure occurs.
Signed-off-by: Patrick Luby <patrick.luby@collabora.com>
Change-Id: Iacb1589eded18f0cb21a5dd8e4d91d295ae697fe
This corrects the reported upload duration
at the end of uploading.
Change-Id: I9d3af4d3dce5aff0c3526ba009fc0b27150bc070
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
It seems more complex to have #ifdef guarded logic
around a function call to pass or not pass an argument
when we that same argument is already defaulted in
that function.
If the difference between the two paths is primarily
the argument, then we can always pass it, making sure
that in the case that defaulting would have been used
that we pass the same default value. This is now done
with assertions.
Change-Id: I333eb3f42cb51dfab8584ae8c5aa52ee45c5a9a1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We could still have session instances in the
_sessions container in DocBroker by the time
we destroy it, what counts is that they aren't
live at that point.
We could still have sessions because we may
be waiting for the kit to confirm disconnection.
But if that was the last session, the kit will
instead exit and that would trigger the
destruction as the PrisonerRequestDispatcher
will have to clean up the DocBroker instance,
hence destroying us.
Change-Id: I8ce103d38edc355d09da046e1b875f0e62768adc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>