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>
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>
Also add state dumping of tile on the fly statistics per session.
Change-Id: I8413cdfd489be3c238738f95d9d5c4aa177ff262
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
problem:
earlier restriction/lock status was sent to kit via browser,
now client session send this status directily to the kit.
this design will require less communication between server and browser
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I6b830f30fb326a5e6637e345250893cbba101de6
and bundle them together when emitted from the browser-side
// i.e. FIXME: new multi-tile-processed message.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I69916cbe30c26686fb44a2d8d229704c459b6601
Also: address parts of #6897, primarily:
* remove the problematic aspect of bumping the last wid in our
TileData, when this could trigger a re-send of a previously
sent delta, causing tile corruption.
* instead append an empty wid entry.
* as an optimization - if the last entry is empty update
the wid - since re-sending an empty delta is of no
concern.
* simplify a number of code-paths that special-case zero length
deltas. All deltas now commence with 'D'.
* still track updates in the JS - by detecting empty deltas.
* shares more code and simplifies various paths.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I02af6d4b152524c201b6985b7a3497da7f08a517
also re-work parseInvalidateMsg to not use std::pair<> returns.
Change-Id: I724783b7050a1ee251dfbe9b2f1e0ea02e7d45f2
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
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
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
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>
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 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>
- adds two new options
1. localize the dialog
2. change upsell image shown in dialog using proxy handler
- provides all the settings using dynamic configuration
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I7e21c1b31c806c88bf54f891de40f02fa342168f
Squashed from feature/deltas-expanded.
TileCache changes:
+ add montonic sequence (wid) numbers to TileData
+ account for sizes of TileData with multiple blobs
+ simplify saving and notifying of tiles
Sends updates (via appendChanges) based on the sequence the
right mix of keyframes and/or deltas required as a single
message, and parse and apply those on the JS side.
We continue to use PNG for slide previews and dialogs,
but remove PngCache - used by document tiles only.
Annotates delta: properly as a binary package for the websocket.
Distinguishes between deltas and keyframes we get from
the Kit based on an initial un-compressed prefix
character which we then discard.
kit can be forced to render a keyframe by oldWid=0
Track invalidity on tiles themselves - to keep the keyframe around.
We need to be able to track that a tile is invalid, and so subscribe
to the updated version as/when it is ready - but we also want to
store the keyframe underneath any deltas.
force rendering of a keyframe for an empty slot in the TileCache.
force tile sequence to be zero for combinedtiles - so the client can
always request standalone tiles with explicit combinedtiles, or tile
requests.
move Blob to Common.hpp
use zero size for un-changed tiles.
remove obsolete render-id, and color deltas in debug mode.
cleanup unit tests for non-png tile results.
Change-Id: I987f84ac4e58004758a243c233b19a6f0d60f8c2
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
For each tile, the wire-id will grow incrementally for each key-frame
or delta appended; so we can tell which deltas to send.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ic5f201d23273c37eed232c5932b9da854e80d06a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Also corrects the counting of number of active
sessions when broadcasting messages.
Change-Id: I5ab5995ed2cbc18b215542d0b2c9568957fd6a3a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The new helper corrects inconsistencies in
detecting writable sessions and improves
readability.
A writable session is one that is either
not read-only or can change comments
(in PDFs, which are otherwise read-only
documents).
Also fixes a bug in reusing the last editor
session to save. The condition should've
been !isReadOnly(), since sessions used
for saving cannot be read-only. Indeed,
the last editor couldn't possibly have
been read-only by definition.
Change-Id: I9860be287057050eca692568d43f77371964f80b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The inWaitDisconnected state is mutually exclusive
with isViewLoaded. So that check was completely
useless. Instead, we want to check if the session
is still connected to the client, since isViewLoaded
implies that we aren't disconnected from the Kit.
This moves this logic to a helper in ClientSession
and streamlines the implementation of
DocumentBroker::countActiveSessions().
Change-Id: I06459708e4c59566aa2e2f1febdfdfe8dd491c35
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This remove reuse_cookies as a setting and feature
altogether. It was originally a workaround to aid
with authentication, prior to having access_token.
However, it proved to be less useful than originally
anticipated, primarily because cookies nowadays have
security restrictions in browsers. In addition to
the fact that access_token simply deprecated it.
While the documentation has also been updated,
tests still have reuse_cookies in input data.
This is intentional to ensure the code is
backwards compatible with any deployment that might
still pass URLs with reuse_cookies around.
Change-Id: If214b299b34a910face8cabc7c1335621990c85e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Problem:
In ClientSession::postProcessCopyPayload() the serialized form of
clipboard's text/html is modified to inject meta origin and sent to the
client. When this data is sent back from client to the server(possibly a
different one) to set the core clipboard via "setclipboard", the parser
gets confused because the 'text/html' part/flavour's data length as
originally set by the core the first time does not agree with the actual
length due to the meta origin injection done previously. As a result the
parsed results of 'text/html' is only partial and possibly the parsing
of subsequent flavours are affected.
Fix:
Add a preprocess step for the payload for setclipboard to
remove the meta origin tag from the payload before parsing is done
(in ChildSession).
The original clipboard payload is created in
ChildSession::getClipboard(). Note that here we encode every flavour
core supports ('text/html' is just one of them) where the type and size
of each flavour data is included. The problem is that later on,
ClientSession::postProcessCopyPayload() injects a meta tag(which is
needed in the client) into this multi favour payload without adjusting
the size of the flavour (which messes up any subsequent parsing of the
'text/html' flavour section and those after it). We could adjust/correct
the size in ClientSession::postProcessCopyPayload(), which is one
solution but the way we do it here (string search on the whole payload!)
without proper parsing seems less futuristic (things can go wrong if we
change the format of packing flavour data in the payload). I feel that a
less hacky solution is to remove the meta tag (current patch) to make it
exactly how it was created in ChildSession::getClipboard() so that we
don't have to do any error-prone size adjustments in
ClientSession::postProcessCopyPayload() or when parsing the payload.
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I285f133829ea0f2dd1cd07d17e90f794ba9a6caf
Add a function emitInstantTraceEvent() to leaflet that sends an
"Instant" Trace Event to the server for logging.
Add a function createAsyncTraceEvent() that creates an object that
records the timestamp of its creation and sends the 'b' event to the
server for logging, and when you call finish() on the object, sends
the corresponding 'e' event.
Finally, add a function createCompleteTraceEvent() that creates an
object for a "Complete" Trace Event that includes the end timestamp
*and* the duration. The event is sent to the server when you call
finish() on the object.
Loleaflet sends timestamps in the above messages from
performance.now(). To enable the server to turn those into absolute
timestamps, the loolclient message is amended to include the current
Date.now() and performance.now() values.
Note that the intent is that when generating Trace Event logs, the
server and the web browser run on the same machine, so there is no
wall-clock synchronisation issues between server and client.
Change-Id: Ie9e68b093b769cc942e1e1d17083febeb07ccf5e
Signed-off-by: Tor Lillqvist <tml@collabora.com>
When writing to the socket, it's always more efficient
to fill the buffer up to the hardware limit for each
write. This is doubly important for efficiency with
SSL, due to the overhead of encrypting multiple
small buffers instead of one large one.
Currently we don't write more than one message
at a time, primarily due to limitations in
the Poco sockets in the unit-tests, which
have a hard time consuming multiple WS frames
with a single poll (subsequent calls to poll
doesn't enter signalled state until new data
arrives, possibly because the data is read and
buffered internally, making the whole scheme
of using poll unreliable and meaningless).
Change-Id: Ic2e2cf1babfb5ab4116efd93f392977ba234d92b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This adds a "view_comment" in addition to "view" and "edit" state
into discovery.xml. In case it is enabled, the filters let the
comment commands through to core.
In addition add "Save Comment" menu action to allow saving the
comments, which is enabled when in "read-only" with "view_comment"
mode.
Change-Id: I3ab3dbee93ee2167ae96adea7025fc0b385f8201
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99473
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>