Fix shared drive failures caused by multiple share-interact permission docs being created for the same sharing#4760
Merged
Conversation
3ae6389 to
986e915
Compare
…s get(permissions check)
986e915 to
fd87add
Compare
…s get(permissions check)
7977e97 to
eb951fb
Compare
taratatach
reviewed
May 19, 2026
| p := &perms[i] | ||
| if p.ID() == canonicalID { | ||
| hasCanonical = true | ||
| // If the canonical doc is expired, update that doc ID but rebuild its content from non-expired docs. |
Member
There was a problem hiding this comment.
Are we really updating the ID? 🤔
Contributor
Author
There was a problem hiding this comment.
mmm, why do you think so? The merged doc is already initialized with canonicalID
Member
There was a problem hiding this comment.
I'm just reading the comment that says we update the doc ID. I was surprised since I didn't see where we were editing the ID.
eb951fb to
fdab8b5
Compare
fdab8b5 to
e40924d
Compare
taratatach
approved these changes
May 20, 2026
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.
Summary
The issue could happen when drive sharing invitations were prepared concurrently: several members could trigger interact-code creation at the same time, and CouchDB generated different permission document IDs. Later reads could pick a partial permission doc, causing missing drive tokens and errors like “member was not found”
Changes
share-interactpermission docs.share-interactpermission docs by merging codes into the canonical doc and deleting legacy duplicates.GetForShareInteractrepair duplicates before returning permissions.GetInteractCodewith the existing instance lock to avoid local concurrent writes for the same sharing.