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>
Avoid SIGKILL'ing children when valgrinding to allow time to save
massif traces etc.
Change-Id: I255a62b6605164ac5037a06455f1adfcba05759c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
When using Nextcloud with source file with spaces in the name
eg. "file name.docx" and we tried to export as PDF
then error appeared.
In the logs we had "SaveAs produced no output in '<...>file%20name.docx', producing blank url.
We need to decode file name similar to convert-to case.
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ic60cefefc4e20b53feee28b86443090c147bb66e
Mobile apps don't substitute these values so set them to zero length
strings.
Also, the iOS app sets the base text direction via the "dir" parameter
so add handling of that parameter in cool.html. TODO: check if the
Android and GTK apps need to implement the "dir" parameter to handle
RTL layout.
Signed-off-by: Patrick Luby <patrick.luby@collabora.com>
Change-Id: Ied8268ec256011281961ef610d53baeee0efe9cd
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
Previously we waited at least as long as
it took to process the last request before
issuing a new one. This can be unnecessarily
long, especially when unloading. Now we half
that time.
We should consider a more sophisticated logic,
especially during unloading, where it's best
to upload quickly.
Change-Id: Id903b8a064bd8431578221dc9386ab08d46dd2dd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
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>
After unloading a document, the ChildProcess instance
may be destroyed by the time that we process the
internal prisoner connection. In that case, we
can't find the ChildProcess so we assume it was
a premature death and issue a warning.
By tracking whether or not a PrisonerRequestDispatcher
had an associated DocBroker, we can supress warnings.
Change-Id: I8bab882283f27f7d5f724e878aae19837445a2fe
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Previously we only waited if a new auto-save has
been issued at the point of disconnecting the
last session. However, we could have a save in
progress, particularly when it's a slow one,
and we should equally wait for it before
disconnecting the last session.
Failing to do so will exit the kit right after
finishing the save and will rob us of the
ability to upload the just-saved version.
Change-Id: I678689a95211fa8b80bcd3e8d4537de7de5d6632
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Also handle OOB values of config setting.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ia0d4e2e0475bfd6d487006847ea0622b573569b7
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
If we have no write-able sessions, we can't lock the document -
fair enough to complain, but not every ~300ms - so defer another
lock period in this case.
Change-Id: I7beb974b3c17fd6ac01a32d8fe50261a54340665
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
There was a naming conflict with infobar event.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I0b2a80bcb6f6e636980f8acff21f39fec5414174
I am a bit surprised that this seems to work. Thanks to Szymon Kłos
for pointing me in the right direction.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ie9740a7a281a2b82ac7ca9fdf5f6374a29feec5d
Using target parameter we move cursor to the desired position.
Thumbnail then is created and sent to the client.
Example target: "image7.png|graphic"
Original author was Mert Tümer.
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I170f6af6fd29c420565feca69b8bef034fd91a66
Which generates PNG of selected link target in the document
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Icfdca2f0b58ea370ca0125c188759e942aacc2e0
There are costs to many threads, and diminishing returns.
Change-Id: I4d4dc0491c48af303375d09d8eb19ffebedcad83
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
The setModified is on an internal, AdminModel
specific, Document object. It is not the
DocumentBroker.
This reverts commit e33d6aa2ca.
Change-Id: Ib706927051678cfc19dc1246d679ef530eb8d586
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Button is shown when CheckFileInfo contains 'EnableRemoteLinkPicker'.
After press UI_PickLink is send via postMessage.
Action should be finished with sending Action_InsertLink to editor.
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I53c61a25d1fab655771742ec6d97dc056192642a
The function-local static prevents tests
from changing the value of a config.
Change-Id: I5febdbf029293fab39f18afa6d905fd571d59545
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Remove assert and allow delta messages to be handled even if
there is no keyframe. Although it might make sense to skip
delta messages if there is no keyframe, that causes some
content, at least in Impress documents, to not render.
Signed-off-by: Patrick Luby <patrick.luby@collabora.com>
Change-Id: I9b1cdc0812d008a6174648b9bc4854519018ffc9
When copying is disabled, we still allow
copy/pasting *within* the document. What
is disabled is exporting the copied data
to the browser.
Luckily, this code was broken, and it
wasn't really blocking .uno:Copy at all.
Change-Id: I50a01eefbe1de3758b4451385bbc51fbde5878a8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This fixes an issue with video not playing back
when another view has selected it. We also move
the URL handling to graphicselection, which simplifies
and improves things, albeit at the expense of
unpacking graphicselection payload, which isn't
as clean as one hopes.
Change-Id: I64f81eabf0f0bc850db83233812eaae6d9e036da
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>
DocBroker's setModified notifies the Admin
of modifications, there is no point in
having the Admin call back into DocBroker.
The only reason that this didn't cause
an infinite recursion is that DocBroker
calls the Admin only when the flag has
changed, and since the Admin callback
is done asynchronously, by the time
the Admin handler is called, DocBroker
had already updated its flag, so the
callback doesn't cause an infinite
recursion.
Change-Id: Ic4028d54338f8043221571c25e332b4c77f6d628
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
routing_rmdoc command is added specifically to notify indirection url
server about document getting removed with its wopiSrc
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ic077f210d520394e3ef8ced778604b7343436328
- make sure online connect to unique monitors
- able to disconnect monitor if uri doesnot exist in updated
json
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ia6cfd6c8e56416c37d211aae55828c92a4ba27e5
- once client get notification it will update the routetoken
by refetching it from indirection url endpoint
- added support to configure indirectionurl enpoint using
remote config
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Iead22af56c655bdece6b70cc4e97a1fa401b1bae
fetch route_token from indirectionurl and add them in wopisrc
parameter
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I6e724d0c59e12d4f7f6c125ec076e90d20b9b3c8
This prepares to start the next test
when the DocBroker of the current one
is destroyed.
Change-Id: I3a9672d8d03ad497f15a9bca262dfe1d4f197e41
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>
This fixes a corner-case where we modify and
save during uploading, which means that the
next save will not have any modifications,
and we will not merge the attributes until
we get new modifications.
Change-Id: I621e26e04ea3e0d04a9a3d535ff2cfc607d56fef
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We now capture the flag that controls the
IsExitSave header directly via the result
of IsUnloading(). This makes passing it
via function parameters obsolete.
Change-Id: Idb4df4f96d66b4a9f92ff9a570f48be895e623be
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Now I hope things are initialised in the right order and the plumbing
gets set up so that messages are passed as expected. It seems to work
most of the time.
Main changes are:
- The online WASM executable is built using the -s MODULARIZE -s
EXPORT_NAME=createOnlineModule options. This means that the WASM
runtime is not automatically initialized and the main() function
is not automatically started. Only when the createOnlineModule()
function is called is that done. Calling exported C/C++ functions
is a little bit more complicated.
- Code to actually Base64-encode strings to be executed as
JavaScript when expected is now present in wasmapp.cpp. (After
being passed through the Base64ToArrayBuffer function on the JS
side.) Whether this is actually necessary is not fully clear, but
to keep the code similar to that in the GTK, iOS, and Android
apps, this is kept as such for now. It would probably work fine to
just directly create the ArrayBuffer in the C++ (using the EM_ASM
magic).
- The COOLWSD::run() function is now run in a separate thread so
that main() can return.
- The FakeWebSocket's onopen() function is now called from
innerMain(), where the HULLO message is sent. It remains a bit
unclear if this really is the ideal place.
In the mobile apps the HULLO message is sent and the onopen()
function is called in the window.socket.onopen() function in
global.js.
But note that despite that the WASM app and the mobile apps are
largely quite similarly constructed and the FakeSocket and
FakeWebSocket plumbing is the same, there is an important
difference. In a mobile app the C++ code is what runs first, and
that then loads the HTML page into WebKit, in which the JS
runs. In the WASM app it is the other way around. The web page is
naturaly the one that is loaded and the JS code then starts
running the C++ code as WASM.
Finally, note that the whole concept that there is a separate "WASM
app" is temporary.
What we eventually want to achieve is that the COOL webpage upon
loading will connect a COOL server. As it does currently. The COOL
server runs the online and core C++ code to load a document, and
renders document tiles and sends those to the client JS code to
dispay.
The new thing will be that, if enabled, in addition to the HTML and JS
resources, the client will also download the WASM code and data
resources. Also, the document and updates to it will be downloaded
while being edited so that a copy can be kept in client memory. But
the WASM code and the downloaded document will remain unused most of
the time. Only if the connection to the COOL server breaks will the JS
start running the WASM code and the JS will talk to online code
running locally as WASM instead of to a COOL server. Obviously there
are still lots of things hanging in the air here regarding how exactly
this will work.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ib1786a0b485d51797b0f2302d4296aa1ff9df5c1
When uploading fails, we shouldn't
rely on another save or close to
happen, we should retry as soon as
possible (right after the
min_time_between_uploads_ms elapses).
Change-Id: Ieabe7656583cf391f637986f5403acc87bdc913f
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 never enter the condition in question
if !_documentChangedInStorage, so the
code removed could never execute.
Change-Id: Ia183b63d7a13f6316eb5f24636997b6e6e417a97
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is necessary for multi-test scenarios
where the flag might be changed between tests.
Change-Id: I2fd9c21bc7ccdf2c9941ca3a959b578ec226facc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Apparently handle_cool_message() gets called from a web worker thread
and then using emscripten_run_script() in wasmapp.cpp to run a JS
snippet that refers to the 'window' variable will not work. That
variable exists only in the main thread. So use MAIN_THREAD_EM_ASM()
instead.
Hardcode the document URL for now also in wasmapp.cpp.
Try to send the HULLO message from COOLWSD::innerMain().
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ic48042c6d0c6239a3b82e74f0565056a15f3d98d
If we are not caching tiles, it is misleading to log "Saved cache tile".
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I0e0ec446d5edf266ea4acb42883c49d5f7063763
This replaces the hard-coded status-code
numbers with named compile-time constants.
Change-Id: Ibe678fb2c533b29efd696e4430f5377523eeb298
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
During unit-tests, it is safe to break the flushing sooner
to reduce the wait time. However, this is risky when
flushing the sockets outside of tests, because there
could still be some important processing happening.
In that case, it's best to wait for the full duration
of the flushing.
Change-Id: I4841510f4e80c3e5bd13b203647828e4c5f89d4d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Emscripten is very opinionated about sys/poll.h so use poll.h instead.
Signed-off-by: Michael Stahl <michael.stahl@allotropia.de>
Change-Id: I9691519e27a080f03a19f0cc0dd8f796fe323062
it will be used to store user data which shouldn't
be shared between views
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I58b7f22e4364ce9e07bb6cc74e8431363912a872
It seems we were inadvertently clearing copies
of the stream caches rather than the real ones.
Change-Id: I3fcce77850e0a8f082bdb926f85ab173148c15db
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
ClientSession::disconnectFromKit() already sends
a 'disconnect' message to the Kit. There is no
point in sending the same message again right
after calling disconnectFromKit().
Change-Id: I03aafc33f85220b53c5ff024601f83132b7046f6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
DocBroker now requests the Kit process to terminate
earlier than before to give it time to disconnect
while we (DocBroker) are still around. In turn,
upon disconnection, PrisonerRequestDispatcher can
query whether we are unloading or not, to detect
unexpected disconnections.
Change-Id: Ifa102e018e32bb252a0c169b0a3df691bca4ab0c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We avoid logging warnings when the Kit disconnects
from a DocBroker that is unloading.
Also, since the PrisonerRequestDispatcher is the
default WebSocketHandler, for ForKit we replace it
before it gets a DocBroker associated with it.
When replacing (which deletes the instance) we
no longer complain that we are disconnecting an
unknown DocBroker.
Change-Id: I94c3aec8578c66c50623196087c4cd157ba85c27
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We no longer emit a fatal (FTL) log when
forced-exiting successfully.
Also, improved are some other logs to
better reflect the severity of the issue.
Change-Id: I22e79f685825f7ecd47cec76c9be9683deff2d55
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
If we already have a closeReason, we should preserve
it upon disconnecting from the Kit instance. For
example when unloading, we request the disconnection
ourselves, so no need to clobber the real reason
for closing in that case.
Change-Id: Ie71faed5a4051659b426e3ba6bbf30950d21c328
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This ensures that when the Storage has
UserCanWrite=false no editing can happen,
no new versions could be saved, and no
attempts to upload would happen, even
on view-only documents (by means of
allowing comments).
When the Storage has disabled writes for
the current user/document, we override
the read-only and allow-change-comments
flags.
Change-Id: Ic140fab4f76209fb143f3f5edef70bc3c80cad1b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This helper is only true if editing of the document
is enabled and not whether or not the document is
writable in storage. Since it unifies isReadOnly
and isAllowChangeComments, which are in Session,
there is no advantage in having it in ClientSession.
It is now renamed to isEditable in Session.
Change-Id: Ib923b6162a8075be145049bc1442c42479c8ce4b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We should always set the read-only flag when
the storage disables writing for the doc/user.
Similarly when the user is locked.
This breaks down the logic of setting these
two flags such that it's explicit and more
readable.
Change-Id: I99ea19b85a529c08fa50b91fb73bffcfba47f996
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
... when it's not in the config file. Follow-up to 53e6bdd62a
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib6a414a3d2d8112255c329f5ef7eedae2901a68b
When finishing the DocBroker poll we also
flush the remaining sockets. This is noisy
if there are no sockets.
Also improves the logs around this logic.
Change-Id: Ife768dbd9db2e201702dcb6d89180fafff5dc16c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Capture the save result early and log how
long it took to save, for informational
reasons.
Change-Id: I0ca04a5b62a2dda38a058f8fa5ca62df33cc0555
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
And move the validation of rename sessionId
where it belongs.
Change-Id: I3fb16ff7b648accaa20b041bf3fd6b82f516cb9b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We mark expired/invalid/rejected authorization
tokens and skip them in the future.
Change-Id: Iec89942198d566901cc2944f22ef86fcb4d6a820
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The idea is that the integration should look for hasZoteroSupport capability,
and if it's missing or false, then it should not enable setting of the Zotero
API key. Instead, it could write "This instance does not support Zotero, because
the feature is missing." or " ... because the feature is disabled in configuration."
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ibff9cb61ada062f59e8b2b63ddcdb7a9cf899b82
add zotero UI only if user is logged in
when zotero citation edit button is clicked,
fetch the library with zotero API.
Let user select what to insert
at this stage its not a complete solution but just first stage
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Id67d8409bcd6416994713acd9ace495b24823fb0
This fixes a regression where the
per_document.idlesave_duration_secs setting
wasn't effective.
Idle save also takes into account the time
uploading finished, or if we had a recent
save issued. This is particularly helpful
for large documents and/or slow networks
where uploading takes dozens of seconds.
In that case, we don't idle-save too
frequently.
Change-Id: I76ee1869003073b5cf9bd420f610bd8a12ff71b3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This avoids an unnecessary lookup in
_sessions, as we already have the
ClientSession instance.
Change-Id: I3dfdfd322fb907f916235a5ccc5f3b76e0eb4855
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The 'load' command is special-cased in the
forwardToChild function. To that end, we
had to parse the message in full, which
is very costly. This patch optimizes
this special casing logic.
Change-Id: I54ff8899b8d250ce996ddabf873a45d92e0f59b1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We dump the state of a DocBroker when we
detect data-loss, or when running a
unit-test that failed.
This simplifies the logic and improves it
by avoiding duplicate dumps and unnecessary
dumps.
Change-Id: I1cf2199d35073a762937ce2cf2377061e40b06b5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We expected the arguments passed to the save
command to be in a specific order, which is
restritive.
Here we allow for any argument(s) in any order
and omitting any/all of them is acceptable.
Change-Id: Ia582f0ac113b3d987c085d3a7975d1b3054ff889
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
introduced in e0752419575f09fef3d770f8cccf78c92a2d8612 commit, update AppConfigMap instead of creating
new one on each of remote_config poll
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: If11bd6e4b3a0a9f4ee32ae9bb43b076479e9bd84
Previously this defaulted to 'trace' - now it can be configured, but
still defaults to 'trace'.
Change-Id: I0ecf2f0b991cd8cc29dbde866dd4589be4ca7957
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Each test loads one or more document. At the end
of the test we may load a new test (a new
UnitWSD/Kit instance). However, because of the
static interface that the tests have, there
could be only one instance at a time. This
means that when we switch the current test
instance, an existing DocBroker might fire
events into the wrong (new) test, making it
fail.
By capturing the current test, we make sure
that DocBroker can never run against different
tests.
Change-Id: I161ec3c9ce1617f41d03b53d2d5fb19682930b78
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The event we trigger when we detect data-loss
is best named to reflect that fact.
And since we can override the behavior,
for example if the test expected to trigger
the data-loss detection, then we can signal
the non-failure by the return value.
Change-Id: I67ca69ae783c956cfdd14d54dab5efb7cc3d258c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Since we can have multiple tests in a single
unit-test .so, we need to merge the results
of each test into a single result that is
used when we exit the process and flag for
failure or success.
Change-Id: Ia49f5542efd6dd998b61c17965fd3fe3245159ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We now properly cleanup unit-tests .so libs.
This helps having multiple tests by making
the dlhandle an independent variable of
all the tests.
Change-Id: Ifc8db400aebfe8ea41dcc4df2d11856c25b36074
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
It's useful to know which extensions are editable
and which are commentable when loading discovery.xml.
Change-Id: Icb06a62eba14240e1d86c4b3cd641531c4fa8e37
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
It's not very helpful to log that some
session is set to this or that without
knowing *which* session the log refers
to. There are many sessions and in a
busy log, it's not always possible to
confidently figure out the answer.
Also log the document loading time and
saving timeout at debug level.
Change-Id: I81fe5e4460f0610a5b941209bc51e4657025c4c2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
And make arguments explicit for a setReadOnly
and setAllowChangeComment.
Default parameters are useful for backward
compatibility, when changing an API. But
they provide no benefit when the function
in question is new and is called a couple
times anyway. Code is harder to read with
default parameters because one has to
either guess (bad) or check (wasteful).
Change-Id: I105df928f4fb73e7c341218af11903bf1ee33943
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
when eTag header is not passed from remote server it keeps on parsing the new settings without clearing old ones
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Iaad9fb6c0e7fd45be3e121b0c0bebaba17d90aab
Since uploading has become asynchronous, it
might not have finished by the time we
unlock the document. This race can result
in the upload to fail, if the document
is no longer locked.
Now, we ensure that the lock is released
only after uploading, when we remove the
session. With test.
Change-Id: Ic9ba3290dfbfde0eb4af7a70bb5b56ff28711f5c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The generated field is
img-src 'self' data: https://www.collaboraoffice.com/https://*:* ...;
while a space was expected before the "https://*:*"
This was introduced with
7e94149ec476445a445ffcd0922d83b1c60c5c64
wsd: Only add one img-src rule to the CSP header
Signed-off-by: Thomas Lehmann <t.lehmann@strato-rz.de>
Change-Id: Ia900bb2508e7f04b111160001c6602e87eae2023
This helps generate the public URL
easily and unifies the processing
of embedded video.
Change-Id: I07ef7f7722f368957a85e41493fe175de38464f7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This extracts the sub-path and the tag
as parameters, leaving the rest of the
logic intact.
Change-Id: I4e08537658e14412a1e56b55508ccb9529b00053
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is compatible with the JavaScript
encodeURIComponent(), which supports
XML embedding.
Change-Id: I38bb64af67789bd5eea3f8f8bdb7f80e313599fb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Draft showing example video preview when activating any shape...
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I37ab8335a3448283abd3c978eb8c62722fd8c7bb
This is needed, for example, for date type cells
for which the format language is set to default.
In this case the load language is used and it
determines the display/output format.
Signed-off-by: Gabriel Masei <gabriel.masei@1and1.ro>
Change-Id: I49ec4940377b261971224d37ea5fbe8ed7006157
When present and equal to 'true', the 'Repair' button and/or menu entry
is hidden in the UI.
Signed-off-by: Jan Holesovsky <kendy@collabora.com>
Change-Id: If8075be479551e0d1a5fa03014aa5e4412578c31
After recent changes in core, it is only the ForKit process that opens
such files.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I69ce1c4caf229b34e42799c525a1f1461a1841e0
define whether locked_host is allowed or not from json
only without the need coolwsd.xml value
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I4c20a56afae3b90c29badc1ecbaec5aa37d07cbd
fetchWopiHostPatterns was used to override old <host></host> which is deprecated and replaced
by alias_groups
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ic16facffdb40eaca504c47a17024cff6ff241950
wopi host can add following input field to their html to override checkfileinfo, right now only
DownloadAsPostMessage is supported
<input name="checkfileinfo_override" value="DownloadAsPostMessage=true" type="hidden"/>
This can be usefull when same html is used to load collabora online in both desktop browser and mobile webview
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8ff122f2824694d451724a832d992e08161fb448
Since the request is really synchronous,
there is no benefit in firing up a thread
and doing an asynchronous request when
we will block until the result is in.
Luckily, we have a much simpler sync-
request API that avoids threads and
callbacks.
Also, avoid failure logs when no
infobar URL is provided.
Change-Id: I06a2f7fb042c8e8d5599bb06ecee5b1afa51911a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
If the connection is closed right after the response was sent
then it's wise to add 'Connection: close' header to the response
so that the client optimizes its behaviour: e.g. does not reuse
the socket for further http requests. Normally a client should
retry a request if the reuse of an old socket fails and that
should solve the problem but still this is an overhead.
Signed-off-by: Gabriel Masei <gabriel.masei@1and1.ro>
Change-Id: I29f1498610c567024def3beb1ad7014f2c15a232