Repository navigation
feat: Resolve access of several docs at once - #5170
Open
taratatach wants to merge 1 commit into
Open
taratatach wants to merge 1 commit into
taratatach wants to merge 1 commit into
Conversation
The list of personal recents will check, for each item owned by another instance of the stack, whether the reader can still read it. `ResolveForMember` works on one target at a time: it loads the doc again, then makes one request for its parent, one for the shared roots on its path and one for the sharings, so a page of items would cost a few requests each. `ResolveDocsForInstance` takes docs already loaded by the caller and makes at most three requests for all of them: one `_all_docs` for the parents of the files, one `dir-by-path` find on the deduplicated union of their ancestor paths, and one load of the sharings. A missing parent gives an error for its target only. The reader is matched on every sharing as the ready member whose Cozy URL has one of the instance domains, aliases included. The email is never compared, as the settings email of an instance is not a proof of identity. The find and the collection of shared roots are extracted from `applicableSharingsForDoc` with no change of behavior for its callers. `vfs.DirOrFileDocsByIDs` loads files and folders in one `_all_docs`, and `vfs.NewFilePatherWithDirs` computes paths from parents loaded beforehand, without fetching again a parent known to be missing. Co-Authored-By: AI
This branch has not been deployed
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.
ResolveForMemberchecks the access of a reader on one target at atime: it loads the doc again, then makes one request for its parent,
one for the shared roots on its path and one for the sharings, so a
list of items would cost a few requests each.
ResolveDocsForInstancetakes docs already loaded by the caller andmakes at most three requests for all of them: one
_all_docsfor theparents of the files, one
dir-by-pathfind on the deduplicated unionof their ancestor paths, and one load of the sharings. A missing
parent gives an error for its target only. The reader is matched on
every sharing as the ready member whose Cozy URL has one of the
instance domains, aliases included. The email is never compared, as
the settings email of an instance is not a proof of identity.
The find and the collection of shared roots are extracted from
applicableSharingsForDocwith no change of behavior for its callers.vfs.DirOrFileDocsByIDsloads files and folders in one_all_docs,and
vfs.NewFilePatherWithDirscomputes paths from parents loadedbeforehand, without fetching again a parent known to be missing.
Extracted from #5135, whose list of personal recents checks with it
the access to the items owned by another instance of the stack.