Bug 113757 - Add config option to report document session termination back to document host
Summary: Add config option to report document session termination back to document host
Status: NEW
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-10 12:03 UTC by Dark Star1
Modified: 2019-07-01 15:20 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dark Star1 2017-11-10 12:03:13 UTC
It would be nice if LibreOffice online could have a config option wherein document session termination could be reported back to the document server. So a url could be provided per document host (relative or full) for LOOL to report back.

e.g
<host desc="Regex pattern of hostname to allow or deny." allow="true">
   <url>my.domain.co.uk</url>
   <session_termninate_url desc="Provide full url if not relative to host.url" relative="true">
       /document/${docID}/terminated
   </session_termninate_url>
</host>
Comment 1 Pranav Kant 2017-11-10 13:13:44 UTC
We already provide a post message to the outer frame, i.e., the document server when the document session is terminated. Hosts can make use of that.
Comment 2 Dark Star1 2017-11-13 13:07:31 UTC
I'm currently poring through the logs looking for this message.
Do you send this post message to the WOPI files endpoint (<host_url>/wopi/files/{fileId}/contents )
 or to the server URL.
Comment 3 Dark Star1 2017-11-16 12:21:42 UTC
After a conversation with Pranavk it would seem I need to elaborate further.
The issue can be described thus.
In a scenario where integration is with a Document Management System (DMS), wherein a document is embedded in a lifecycle, it could be desired to halt a process regarding a document that is under collaborative editing by placing a locking mechanism on the document during editing (For instance prevent checkout but not the additional joining of users to the document session). 
However because document views can be terminated in numbers of ways which can circumvent reporting by the PostMessage mechanism, it would be beneficial if the wsd could report it's termination of a document session (i.e. when document has 0 sessions left) to the document host (possible via a configuration element where a path can be given relative to host url as mentioned initially, for example), such that the host could then simply make use of the information as it sees fit.
From the logs:
[1] wsd-15823-15831 11:42:12.828411 [ prisoner_poll ] INF  ~DocumentBroker [/document-host-path/wopi/files/3032e206-0331-4815-aab9-2f6c01257be9] destroyed with 0 sessions left.| wsd/DocumentBroker.cpp:345

The document host could be notified of the same message, when it the above piece of information is also printed in the logs.
Comment 4 Xisco Faulí 2018-11-27 13:00:30 UTC
@Pranav, any opinion here?
Comment 5 Xisco Faulí 2019-07-01 15:20:11 UTC
This enhancement has been in UNCONFIRMED status for a while, moving it to NEW...

Note to the reporter: Changing the status to NEW doesn't mean the enhancement is going to be implemented. In order to do so, either you implement it yourself, you find someone to do it for you or you get professional support < https://www.libreoffice.org/get-help/professional-support/ >