Commit graph

22374 commits

Author SHA1 Message Date
Andras Timar
9c88df9162 Bump version to 23.05.6.2
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: If6665aba498e4e130891b7c325c36b225cb83c45
2023-12-11 21:59:12 +01:00
Caolán McNamara
3d6838e300 serve wasm metadata
[ websrv_poll ] ERR  FileServerRequestHandler: File not found: Invalid URI request: [/browser/515f66e2bc/soffice.data.js.metadata].| wsd/FileServer.cpp:738

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I6e4bb8a5a617f4ff8921430eae1f23147fd1a8cd
2023-12-11 19:28:18 +00:00
Szymon Kłos
515f66e2bc Update viewId in Writer after recover from idle
There was a bug in Writer not allowing to successfully reconnect
after idle state if we were not a first view in the initial document.
Let's update view id even if document size wasn't changed.
Added also additional error logging to be sure we never use -1 viewId which is
a default "bad value" when we enter some unwanted state in the core.

Steps to reproduce:
1. set per_document.idle_timeout_secs to something small, eg. 30, so sessions time out quickly,
2. Open a document with 2 sessions (remember which one was loaded first - A, important!)
3. wait for it to idle out in both sessions
4. activate SECOND session (B) by click on the document area

Result:
in the browser console you can see an exception:
Exception TypeError: this.map._viewInfo[this.map._docLayer._viewId] is undefined emitting event viewinfo: [{"id":0,"userid":"2","username":"LocalUser#2","readonly":"0","color":411298}] cool.html:359:37

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I23775230e169f61cb816b819f2dea56e293b20e1
2023-12-11 13:04:59 +00:00
Caolán McNamara
e903234ec4 cid#336278 COPY_INSTEAD_OF_MOVE
and

cid#318879 COPY_INSTEAD_OF_MOVE
cid#318863 COPY_INSTEAD_OF_MOVE

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I4a2313bd23a0a9b7134d004ebc29db5caebbb17d
2023-12-11 09:25:59 +01:00
Caolán McNamara
5a01a21e27 cid#336285 Dereference null return value
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ia0506d22a928fc810110895f3b00db33e3c28c5c
2023-12-11 09:25:59 +01:00
Michael Meeks
eeea000242 Re-use the current time for a small efficiency win.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I1183a02c5b41554a059cc222f9de82b592ac6322
2023-12-09 21:56:01 +00:00
Michael Meeks
7382a56591 latency: switch tileprocessed to track wire-ids per-connection.
To manage latency, we need to keep the amount of data-in-flight
manageable, this was previously done per-tile - however this is
less useful in the era of small deltas, and seems over-complicated.

Instead track processed tiles by their wire-id to save time,
space & bandwidth.

Change-Id: I1039d8d4ca96fb172278a824fe1ffd55d9fff23e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-12-09 21:56:01 +00:00
Michael Meeks
a9c0db4bcb Significantly simplify tile rendering on invalidation.
Accurate per client tracking of wire-id and avoidance of duplicates
is vital for good delta application, and is done precisely by the
ClientDeltaTracker class.

The inaccurate, _oldWireId tracker imperfectly tracked wireids of
the last tile per session, and used this integer for the boolean
oldWireId used to determine whether to create a delta; in an
un-necessarily complex way.

Instead we more accurately use the TileCache to determine if we
already have a key-frame, and if so use this to encourage Kit to
generate a delta if possible. there seems to be a potential race
though between the Kit's delta-cache size, and what keyframes
we have in the TileCache requiring further investigation, but
this is not a new issue.

Change-Id: If6cec4c1da31f7b715336c60d1dd6f358e1ef6a4
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-12-09 21:56:01 +00:00
Michael Meeks
0e1972faba latency: don't throttle wsd -> kit rendering on render queue size.
Instead throttle rendering only based on the number of tiles on
the fly down the coolwsd <-> browser socket.

It is almost certainly better to let the Kit process sort and
prioritize rendering with a more holistic view of all rendering
requests, and to elide duplicates - rather than to stack-up some
requests in coolwsd.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I566959306815ddc2742a0fe2694df6a1371c6852
2023-12-09 21:56:01 +00:00
Michael Meeks
395b44b6be remove unused code: ClientSession::clearTilesOnFly.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ie5d8212766afb58d19690b607bea6572407e1adf
2023-12-09 21:56:01 +00:00
Michael Meeks
dbcf3218c1 welcome back to the 'break' statement - all is forgiven.
Change-Id: I9c64530ce12861ea63f0b6bc2c5d04743d5672b6
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-12-09 21:56:01 +00:00
Ashod Nakashian
e836637aae wasm: wsd: coolwsd remembers disconnected mode preference
Switching to disconnected mode works.

Change-Id: I653b282af41bac483c76564fdcf72a83a79065e1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
9deaf06fb5 wasm: wsd: client handler to switch to disconnected
Change-Id: I678ebfae7ed3d9b877a0fe0af6f6ee3add44cb2d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
1653d48a4f wasm: wsd: switch modes handlers - check and save
Change-Id: I7eef953aff077f20c50568b180ab7a1833655533
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
fd5c130d2d wasm: wsd: make switching wasm-only
Change-Id: I13386d60a469ec05c5b15369c32c5b3ccdffa232
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
20508cf5a3 wasm: wsd: switch modes handlers
Change-Id: Ic56186baf54a51630f3d902175bee23b118a31f3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
d9b020237b wasm: browser: add UI button to switch modes
Change-Id: I8e1f7e40a04b5b9eb5be935ecfa6f37ad0e96c9a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
6a42339640 wasm: log to stdout instead of stderr
Change-Id: I747945635c749127d2851cab1f738f4fa58d99f7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
4879049d9e wasm: disable file and color logging
Change-Id: Id9d13552af7e963739e6c30e5faa97519ddec76a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
8d49d33da4 wasm: truncate string only if will log
Change-Id: I7bcc420633563abb858354a7cdb6c4a74c79b548
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
87fdb4a185 wasm: header include cleanup
Change-Id: Ia6396d9e10b9597602a88fced932c27c329b394b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
a96f8a0f92 configure: WASMAPP is now defined for WASM targets
This is in line with MOBILEAPP and GTKAPP and
is independent of __EMSCRIPTEN__.

Replace all application-specific cases, leaving
only toolchain-specific ones (such as include
protection).

Change-Id: Ic44288aa5ace51e0a8b54566170c19120f7bf0dd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
1954f9abcb wsd: reduce includes where possible
Change-Id: I99f489e57cb9391ea819d52b49b0d0034a289cf9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
2255238711 configure: enable rtti with sanitizers on C++ TUs only
We now have at least one C TU and enabling rtti for
the sanitized build breaks things. So we don't enable
rtti for C sources, which was done in error.

Change-Id: If7624993ceb9e7af7aa8ffe3df69069ea4dd153a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Bayram Çiçek
a04b0c4201 Calc: make grouping responsive for each group level
Signed-off-by: Bayram Çiçek <bayram.cicek@collabora.com>
Change-Id: I68572eb126acf4a00ed96af870c1f908083aec8b
2023-12-08 16:23:24 +01:00
Caolán McNamara
1bd1e5a828 wasm is derived from the mobile, but doesn't have on-screen keyboard
There's a bit of a mobile/wasm munge with wasm considered a subset
of mobile in some places which should be unwound a bit, but for the
purposes of usable wasm by default, don't assume that wasm has an
onscreen keyboard so we don't lose keystrokes on assuming that
there will be an onscreen keyboard appearing when we lose and regain
focus.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I0baae0d414ce9aafd1c27d74bcdad2276d104ee5
2023-12-08 14:17:27 +00:00
Caolán McNamara
cf33d0bdd0 update wasm.README for distro-config
the default suggestion uses --enable-qt5 which isn't needed for
LOKit and breaks finding custom notebookbar widgets so online
notebookbar doesn't work with it.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I644924a0f8cdb01d4ec20d70ff7aedb27a2c899f
2023-12-08 14:08:30 +00:00
Rash419
169567b3cc fix: persistent snackbar after the document get idle
- previously, when document was getting idle, it was
  showing a snackbar "The server is disconnected" which
  unnecessary plus the snackbar was persistent even
  after reconnection.
- There are two scenarios to be tested,
 1. It shouldn't show snackbar on idle
    - Set per_document / idle_timeout_secs to something small, eg. 30,
    - Open a document, and wait until it idles out.
    - make sure it doesn't show "The server is disconnected" snackbar
 2. It should show "The server is disconnected" snackbar when you shutdown
    the server, when you start the server again snackbar should disappear

Change-Id: I4ccc93dabb4dd260338d5a941b18ebaf8e42b1ad
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
2023-12-08 18:56:34 +05:30
Pranam Lashkari
009cb14c07 cypress: added multiuser annotation tests
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I9afae096d7a9e925e01e0c9faee57254ed1d074d
2023-12-07 22:38:59 +05:30
Pranam Lashkari
0c0fcd57db annotation: avoid wheel event handling for comments
it was previously required to handle comment scrolling separately but not anymore
it was introduced in a3e59d1

current problem:
when a comment is very long that it overflows and has a scroll bar,
it is only possible to scroll using the scroll bar and mouse wheel didn't work

fixes #7735

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I6d9f85c61b837f86e021a795e8af43b375a318d1
2023-12-07 22:06:08 +05:30
Pranam Lashkari
6ccb1a8d98 annotation: only allow to edit one commit at a time
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Iaa021be2327294e5e34bf6b56de35894f36f263c
2023-12-07 15:38:13 +01:00
Pranam Lashkari
93bdcc349b Annotation: revamp comment autosaving
Original approach before comment autosave:
When we save a new comment, original DOM element which user was editing
is removed from the DOM and new comment DOM element is created from the data and message sent by core.

Previous comment autosave approach:
When we save a new comment, original DOM element which user was editing
is not removed but kept in editing mode. We register the comment message sent by the core
but react and create new comment DOM element only after user clicks on save or cancel.
This lazy initialization caused many regression due to juggling of the new and old comment DOM element.
All these problems were in JS side only, reloading doc would bring comment in correct state.
This approach gave smoother transition between different comment states without any flickers.

New comment autosave approach:
Simple as the original approach, when comment loses focus we save it as normal comment.
When new DOM element created via core comment message, we immidietly set it to edit mode.
This approach may have a little flicker when we replace old comment DOM element with new comment DOM element.
Overall this approach requires less condition checking which makes it easy to maintain and hopefully reduces any regression from previous method.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I4098085825ede65cdbf2e2243fc4d2bb1f63c716
2023-12-07 15:38:13 +01:00
Pranam Lashkari
3916a443fc Revert "annotation: avoid saving comments on losing focus"
This reverts commit 51d19dd60e.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I60ecf1cc7f9b61c41b95ddd5ceb6caaf72036e3e
2023-12-07 15:38:13 +01:00
Pranam Lashkari
ca64805e23 Revert "annotation: autosave comments when lose focus without exiting editing"
This reverts commit a022212381.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I6431fc2500fe44a8d97364aa89412206179c7aba
2023-12-07 15:38:13 +01:00
Pranam Lashkari
630a2e74d2 Revert "annotation: fixed autosaved comment cannot be closed"
This reverts commit dda49b0af6.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I0be7ff41777eece8a0bbe5a52219c076d78ac3be
2023-12-07 15:38:13 +01:00
Pranam Lashkari
05f4fa9564 Revert "annotation: make sure comment list is fetched correctly"
This reverts commit a373b6e121.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Iaae5932eeb29f90a0d22439dba53897ef7b4fafa
2023-12-07 15:38:13 +01:00
Pranam Lashkari
70ad32d885 Revert "annotation: avoid trying autosave empty comments"
This reverts commit 6a4cd7eea5.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Icc20b9e055ccb8d7a1d78635f0c659696110d0a6
2023-12-07 15:38:13 +01:00
Pranam Lashkari
a92342c86e Revert "annotation: avoid marking comment autosave if its not saved"
This reverts commit 2c720a6a87.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I99869bfa017e704053589264242a17add727ce74
2023-12-07 15:38:13 +01:00
Pranam Lashkari
ae523fc611 Revert "annotation: forcefully reselect comment before modifying"
This reverts commit 4d7df8ae9c.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ia3770347cec0d3949e6459b4c412c52c5e0f1116
2023-12-07 15:38:13 +01:00
Pranam Lashkari
3fc486a131 Revert "annotation: fix parent comment being deleted if reply cancelled"
This reverts commit 91cbc8c404.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I0e995f1b2eb1451943d56f86829e4f09860a43e6
2023-12-07 15:38:13 +01:00
Pranam Lashkari
108987e3e5 Revert "annotation: fix cancelled modification of autosaved comment"
This reverts commit 30f6c14b9f.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I87e3e3a6732c3d182f0724ece52fca2cbbd8dc99
2023-12-07 15:38:13 +01:00
Pranam Lashkari
c0a0160644 Revert "annotation: fix parent comment being deleted if reply cancelled"
This reverts commit 5c965044ec.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I4157cffe38beccd675b33f2417617025b226eafe
2023-12-07 15:38:13 +01:00
Pranam Lashkari
e079ac34cc Revert "annotation: fixed impress disappearing comments on autosave"
This reverts commit d7e07b773f.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ifafef55b97871aa01c851abb6a1c87edb84b9862
2023-12-07 15:38:13 +01:00
Pranam Lashkari
f0e68b7590 Revert "browser: fix duplicate comment reply on autosave"
This reverts commit 4ba4c61aad.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I39bee7e5b2033e7fed1ab8a3066ebf43aa1be4da
2023-12-07 15:38:13 +01:00
Pranam Lashkari
8a592db923 Revert "annotation: reset comment id if autosave is cancelled"
This reverts commit 3c1ac04b0e.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I842f8fc7feac01685785af72929974fc4fa397af
2023-12-07 15:38:13 +01:00
Pranam Lashkari
bdbe2dfa51 Revert "annotation: make sure parent-child relation is established"
This reverts commit ab064bacc7.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I073bc9045e68ed78424681a3c9c70696cbfece3f
2023-12-07 15:38:13 +01:00
Szymon Kłos
b9e5a51315 Update network access error strings
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: If44683da69ce05b8271117338f2e059bad15182d
2023-12-07 14:58:42 +01:00
Szymon Kłos
675afcf60b jsdialog: introduce JSDialog.showInfoModalWithOptions
Helper that is easier to use as has "options" parameter
not a long list of possibly optional ones...
It is first step to refactor old UIManager.showInfoModal
helper, which is less flexible.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I34eae39cab583985ad3d940aa025aee0a374e25e
2023-12-07 14:58:42 +01:00
Szymon Kłos
bbcf9053b9 Show info modal on network access error
If administrator doesn't allow some URLs in the coolwsd.xml
under net.lok_allow then when pasting webpage with images
- it might result in missing pictures. We should show the
user what happened.

User can click "don't show this again" to avoid annoying
dialog on every paste.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iec9035860b1c6a332420defd539000e8854447c9
2023-12-07 14:58:42 +01:00
Andras Timar
af36021b6f Do not refresh notebookbar when we start in read-only mode for txt and csv
This is a workaround for the bug, when a txt or a csv file was opened,
and there were both the classic menu and the menu of the notebookbar
at the same time at the top of the window. This bug occurred because
regardless of the user's UI mode setting, the read-only mode has the
classic menu. The fix also have a side effect, that is better than
the original symptom. Now when a txt file is opened, and user starts
editing it, the Zotero buttons won't be on the References tab. I
think it's a good trade-off, but FIXME.
Eventually, when we won't have the classic UI mode any more, this
problem would be solved better, for all corner cased (txt. csv, pdf,
read-only shares etc.)

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ic3f95c02a0b75136a0b8069fa8297ed129b63865
2023-12-07 14:34:23 +01:00