fix(wopi): stable guest UserId and correct IsAnonymousUser for named guests#5601
Open
Arildm-no wants to merge 2 commits intonextcloud:mainfrom
Open
fix(wopi): stable guest UserId and correct IsAnonymousUser for named guests#5601Arildm-no wants to merge 2 commits intonextcloud:mainfrom
Arildm-no wants to merge 2 commits intonextcloud:mainfrom
Conversation
joshtrichards
requested changes
May 6, 2026
Member
joshtrichards
left a comment
There was a problem hiding this comment.
Good catch! Makes sense.
I'm surprised I can't find any open bug reports on this topic.
Anyhow, from my end, as noted, I'd just like to see the output bumped up from the hash.
P.S. #2170 impacts this too (I assume). But that's not guest specific - and, more importantly, this is still a good improvement. And, presumably guests will likely also benefit from whatever eventually targets #2170 anyhow (by virtue of this change).
…guests Two issues prevented cursor presence from working for named public link guests: 1. Guest UserId was randomly generated on every CheckFileInfo call. The WOPI spec requires UserId to be stable per user session. Use a deterministic hash of the WOPI token instead so the same guest retains the same identity for the duration of the session. 2. IsAnonymousUser was unconditionally set to true for all public link users, even when the guest had explicitly entered a display name. Collabora treats IsAnonymousUser=true as a privacy signal and hides the cursor from other editors. Only set the flag when the guest has no display name (truly anonymous), so named guests have visible cursors in collaborative sessions.
Addresses review feedback: bumps substr length from 8 to 16 hex chars (64-bit) for Birthday Paradox mitigation on guest UserId generation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4f553df to
e93e9c8
Compare
Author
|
Thanks for the thorough review, @joshtrichards! Both requested changes have been applied:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two bugs in
WopiController::checkFileInfo()prevent cursor presence from working when a named guest edits a document via a public link alongside a logged-in user.Bug 1 — Guest
UserIdis randomly generated on every WOPI callThe WOPI protocol requires
UserIdto be stable for the duration of a session. Collabora callsCheckFileInfomultiple times (e.g. on token refresh), and each call returned a different random ID for the same guest. Collabora treats each new ID as a new user, breaking cursor tracking and view presence entirely.Bug 2 —
IsAnonymousUseris unconditionallytruefor all public link usersCollabora interprets
IsAnonymousUser = trueas a privacy signal and hides that user's cursor from other editors. This is correct for a truly anonymous viewer (no name entered), but wrong for a guest who has explicitly entered a display name in the Nextcloud sharing prompt.Fix
UserIddeterministically from the WOPI token using SHA-256, so the same guest token always maps to the same identity within a session.IsAnonymousUser = truewhen the guest has no display name. Named guests getfalse, enabling cursor visibility.Steps to reproduce
Expected behaviour
Named guests have a visible, coloured cursor indicator, just like any other named collaborator.
Tested on