From our API description:
DisableCopy
Disables copying from the document in libreoffice online backend.
Pasting into the document would still be possible.
Change-Id: I1f7e272ad3b04208b534eff990fed895951b4751
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
"Async" here refers a specific kind of data in the Trace Event JSON
format, not asynchrony in general.
Actually, we don't have code that would generate such yet in
loleaflet. Just the createAsyncTraceEvent function in Socket.js. Quite
possibly the "Complete" events (a.k.a. ProfileZones) are all we need.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I611ccd4b964bcacdd1050893f70dbdb813ee3c34
Since a99edb5d29 this gets a different lifecycle, and is often
joined and gone by the time we get to cleanup.
Change-Id: Ic21ca837d484a9a853c7f8f683e876406b00a943
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Also clear its input buffer explicitly.
Change-Id: I8badbb96d98eaf10433a65fcfd13b0d6d5893594
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Ignore input in a somewhat gentler way.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I758302dc3bb1aa87f9fbfa726f73f4b9339e08c2
When running tests in parallel, closing the server listening
port before all DocBrokers are terminated runs the risk of
the listening port getting recycled by another test. This
means that the new test might get unexpected connections
from the old test that is shutting down.
This improves test stability.
Change-Id: I2c6ac9e7ed9953813e0da6ab19b960b1edc1d1a8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The original behavior must be preserved, which is not to
initialize SSL when termination is enabled but SSL is disabled.
This reverts commit 1c9541a6a636647086397e1310084cc990b6ed70.
Change-Id: Iba3ed3eea45b6b78e696334ca4d1a4a2c014d95b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
If the last upload had failed and we are closing,
make sure to save a new copy (i.e. save even if
unmodified) so we would have the latest version to upload.
Change-Id: I25efb76eaf9c0e05a2d18071b273447803b17cc5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This prevents auto-saving while a
save is in progress.
Change-Id: I2606df704482ad54a954414d48ed3ca35d4764a9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
There is an important distinction between
internally saving a document and uploading
the latest saved version to storage.
Core reports the modified state, which was
at some point used to flag the modified state
in the admin console. This state is misleading
if uploading failed.
This patch makes this distinction even more
explicit than it was. We now always update
the modified flag given by Core, and flag
the document as modified in the admin console
too. But we only update the admin console to
unmodfied when we successfully upload and the
document is not modified at that point (which
it might very well be modified again by the
time we finish uploading).
Without this patch, we stop updating the
modified flag when uploading fails. This
is problematic when said failure occures
right before closing the document, because
the document will have no modification
but we will be stuck thinking it is modified.
This combines two commits:
8c602e179e
and
9db39ce741
Change-Id: I31c72aa2491b8e98597075cd35b6a809fab560a1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
During the save during shutdown we can get big invalidation
emissions, there is no point in re-rendering the view at that
stage; so skip it.
Change-Id: Ie85ef57648815a1872ca35dcb1bdfc9fa54e64c0
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
remember correct URI so all the following communication
(eg. downloading the file, upload) will be performed on new location.
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Id14c5209eb1d9ffc7c24d7e02f0c7c32a60568b7
With some loadbalancers it may happen that HTTP 302 Found
response with redirect location will appear.
Change-Id: I7bac807761423adcd827cf775bd1d3d2ba87a6cc
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Makes unit-rendering-options fail reliably.
This reverts commit 175c9c5b2a.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Id05c911991baaae0dbc52678a192fc01639352e0
By passing a traceevent=yes query parameter in the URL. Note that if
Trace Event generation is not enabled in loolwsd.xml this will have no
effect.
It is a bit silly to notice this query parameter only in loleaflet and
then send the information back to the server. Would be better if the
server noticed it itself before sending the URL to loleaflet.
While at it, let's not bother ever enabling Trace Event generation in
the WSD process. That is not what we are interested in.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I985bfd1e2dbd14aa5a55b386b4762fb64bcb4008
We ask for save as for the plain/text type documents
such as csv or txt. Notify other views about it so
they can follow one to the new document
Signed-off-by: merttumer <mert.tumer@collabora.com>
Change-Id: I4cdcec6148d1064ad4e90ad9be2ce483c19a8eda
I have seen cases where the time stamps in the Trace Event JSON end up
very wrong, which makes them useless. What mechanism causes this is
unclear. But at least let's not believe such data.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ic5528e73e502e3691b69d91f57d2fa06de47f5d0
And not that of the corresponding Kit process, which confuses the
Chrome Trace Event Viewer, as the same pid and tid will appear for
Trace Events actually from that Kit process.
(Yes, we should use a separate, synthetic, pid for the loleaflet Trace
Events. In an upcoming commit.)
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I34298abf5c5f5ef099338d8d3a94b0026131615b
Write to the Trace Event JSON file in just one place, protected by a
mutex.
Handle metadata events separately. We want them to propagate to the
output if Event Trace generation is just enabled, regardless whether
it has been turned on or not.
We can send the metadata for the Kit process only after we have opened
the docuemnt as sending a Trace Event to WSD uses the (singleton)
Document object in Kit.
Introduce some new functions for the above and adapt callers
appropriately.
Generate a Complete event for the handling of one image tile, from
setting the src attribute of the Image object to finishing the onload
function.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I5978e0fb2495e0d2dc479bf861eb4ac7da03fa50
We automatically emit metadata events that identify threads.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Icb25b5cfc29b28ba7112ca72de56dbb697c8dd5a
In MobileApp builds, the 'else if' was evidentally
getting chained to the unrelated if/else clauses
before the '#if !MOBILEAPP' at line 434 of
DocumentBroker.cpp.
Now this 'else if' is a standalone conditional
in MobileApp builds and it's part of the
'remove idle documents' conditional chail otherwise.
While fixing that, the missing indentation
of a for-loop under a conditaional is also
fixed, to avoid confusing maintainers.
Change-Id: If3de18f385d84cb22d757cf73743fd8541c36df9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Templates are special because the file that gets
loaded is not in the same format as the final one.
An implicit save-as is issued in Kit for template
loads right after loading to create the final
document format. It is this file (as opposed to the
template) that needs to be uploaded, which we do
right after we get the 'status:' message in
DocBroker to actually create the first version
in storage.
Change-Id: I23cbf527f1059b0b4059f15069737ab35ac860e7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
To avoid writing (saving) while reading (uploading) or
any other undesirable racse on the document file,
we atomically rename the file after saving on disk
to pass ownership.
After saving in Core, we rename the document in the
jail to .upload (by appending it). DocumentBroker
looks for the file with that extension and atomically
renames it to .uploading (by appening the 'ing' suffix).
This way, the Kit only renames from the original to
.upload and DocBroker renames only .upload to .uploading.
This guarantees that we never rename the same file
concurrently.
Uploading decision is strictly based on the modified
timestamp of the .uploading file, compared to the
timestamp of the last file we uploaded successfully.
Change-Id: I03520cd8c87605f6dad417e7a978204f76fc0c38
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This makes sure that if the document isn't modified, we
will detect no change from the storage as well and
avoid making an unnecessary upload.
Change-Id: I8ba2850921d75c96b2aa4f6deb86891b4fad0ea0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The client always issued a save before renameFile.
This worked fine until we make uploading asynchronous.
Now that uploading is done asychronously, the renameFile
command arrives while uploading is still in progress
and fails because renaming is done via the same
storage API used for uploading.
It is best to do both the saving (including uploading)
and renaming directly in WSD, instead of relying on
the client to save explicitly before renaming.
Change-Id: I99f6294f4c83130bc13ec8e3b013ba0192f0f84c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Some user-initiated activities, such as renaming
the document filename, is either a multi-stage
activity or involves async operations.
Using a new Activity enum in DocumentState, we
now track each of the different activities that
needs special attention or handling.
Change-Id: I9cd2d04b10a97387ce02f5c3cc98b41a1732af6a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>