Added a debug option (triggerable using the about debug menu) that
allows you to dump tiles as they come in
Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: If5939b816c1e3598e50c2db4971710524f855909
We handle notification from core about currently focused paragraph:
content, caret position, text selection start/end.
Notifications are sent on any text changes, even when the text has
been modified in another view.
Moreover we can request such info to core at any time.
That allows AT software to read focused paragraph and selected text.
All that keeping editing still working.
A set of new cypress tests for checking clipboard content has been
developed.
failing cpp unit test:
- HTTPWSTest::testInactiveClient
'unexpected message' assertion was failing since an idle client can
receive an a11yfocuschanged message when the same paragraph has focus
in both view and the active view is editing the paragraph.
failing cypress tests:
desktop
- calc/autofilter_spec.js
- added more wait time before performing clickOnFirstCell
- impress/undo_redo_spec.js
- Repair Document was broken
- we need to select 'Hello world' in order to overwrite it
mobile
- impress/spellchecking_spec.js
- Apply suggestion
- better use selectTextOfShape instead of Ctrl-A
Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I070d390543fa66fe786c4a0661fa09f891b9883e
Make sure that the logging subsystem is
already initialized before starting
unit-tests.
Change-Id: I2ce3ffdb2d3b0094ae7ed496d7cacfc02af89c21
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
followup for:
commit 012b00d
linking-api: always response for thumbnail render requests #6229
in calc and impress we don't get cursor message when switching to
target (slide, range), so don't check if target was reached,
statechanged messages are good enough signal we are loaded already
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I63aa5aefeef153d4d6e2b483e1cdb7bf2c6268ac
follow up for 25efeea0d8
missing const in modified function caused build error
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ic0f4ae39476e16a9a49904e06b44f26d2a5d4fe7
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>
The call duration is already logged elsewhere.
No need to pass it around and log again.
Change-Id: Icef50b9a8a48dcecc78a6b99c6311fc0d5b2a676
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 request target which doesn't exist or it is the first
character in the document, we receive only one cursor invalidation
in that case we didn't respond at all for the request because we
were waiting
this patch added fallback, so when we receve statechanged messages
we know we already loaded document so we don't need to wait more
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ib25ab4f4d68809e3ef97ccb826ba44aeee2f71dc
This is the product name served by hosting/capabilities
endpoint. Also, it is used by update checker.
It can be defined --with-app-name build time, but if
we would like to configure it run-time (e.g. with the
brand package), then we need a config setting for it.
E.g. brand package could execute
coolconfig set product_name "foo bar"
in postinstall script, if necessary.
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I8e72d3a3735e3a77c7aaac9a88b2c0fc6a957c0e
Previously the help root URL was defined in coolkitconfig.xcu,
but it was inconvenient to change. Now we have this setting in
coolwsd.xml, therefore it can be changed more easily. For
example a brand package can disable the Help buttons on
dialogs by executing the following command in postinstall
script:
coolconfig set help_url ""
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I6d0bdd71ca908df3d2dd20bd321aff9e93896f52
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>
The QuarantineMap is shared between DocBroker
instances, which makes it subject to concurrent
access and modification. As such, it must be
protected via a lock.
Change-Id: Id62587b33123748f848110a5427da3e296725de9
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>
We now use the timestamp in the quarantined
file, not the modified time on disk. Since
we have the timestamp, we should use it.
Change-Id: Iaf4a9cab2203da3e3842d7fe46b4578a031f0958
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
No need to encode/decode docKey,
since it is always encoded already.
Change-Id: Icd9c6d24ca57e9f0ffb06efc7052df175d5d383d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
config.h should only be included in .cpp files,
never in headers. The reason is to avoid having
it accidentally included, which would also
allow for it being effective only in subsequent
code, not those included earlier.
To avoid these problems, each .cpp includes
config.h at the top, so the configuration
directives would be effective throughout
the translation unit.
Change-Id: Idae87e5ee51abe454cc2a53d6f60dc07f64d0c35
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>
There is no good reason to check the config
repeatedly, especially that once we initialize
we should have the state.
Also, we should be able to disable quarantining
when we hit an error during initialization.
(As an aside, reading the config is slow and
throws exceptions that are caught internally,
which makes debugging for exceptions frustrating
when we repeatedly read config entries.)
Change-Id: I44a7800df96a370ef4d4cc1d6bb171f60f1499a0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We use our own status codes, which
are type-safe and use streaming
operators to serialize and log.
Change-Id: I0eba7b16694866b5a79476a7ef4b1b78f7f9c176
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>
load using script interfaces.
There is use case such reverse proxy uses another domain
to request the l10n json resources, but the CSP Chrome triggers:
l10n.js:62 Refused to connect to 'http://192.168.0.2/localizations.json' because it violates the following Content Security Policy directive: "connect-src 'self' ws://192.168.0.1:9980".
request_JSON @ l10n.js:62
String_ctr.<computed> @ l10n.js:85
(anonymous) @ l10n.js:263
(anonymous) @ l10n.js:286
l10n.js:62 Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://192.168.0.2/localizations.json'.
Change-Id: I57fff24c00adebdf7dd06929d6341ea14554a6d2
Signed-off-by: Henry Castro <hcastro@collabora.com>
This avoids removing the jails of other running coolwsd that share
the same jails/ directory, such as unit-tests, cypress tests etc.
Assert on fatal system error to help catch this during test builds.
Remove old unit-test specific approach, and generalize it, since
apparently we did a recursive cleanup of other people's jails anyway.
Remove over-complicated recursive approach, for a rather simpler
one-level scheme. Avoid following symlinks too for safety.
Remove obsolete lo_jail_subpath setting.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I371f8c0e22f64fb2befb4b58f72cefa39567f3b5
add forcecaching parameter to coolwsd for debug mode.
Change-Id: I6f38e9a4fd6dbb76e92105c76e8abe3e75f19ef5
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Particularly annoying with trace level logs
when they trample over one another.
Change-Id: Ib1a8f8b8117364886af5043120e65ec7cb12e12a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The port used for client connections does change when
we cannot connect on the default/first one. There is
no point in announcing the default when we don't
yet know the actual port, and similarly it's not
helpful to do so before the server is even started.
We also move the remote-font-config thread to an
earlier point and merge it with another #if !MOBILEAPP.
Change-Id: Icc28817c7a03d49a7e130b076e545fe3ce2fb81a
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>
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>