Repository navigation
A folder grant settles the other open asks it covers - #1068
Merged
Merged
Conversation
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com> (cherry picked from commit c0fedb7cd3c05c5ba7f8f9c309114b8aa4481c01)
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Two parallel reads file their consent requests in either order, so taking the first request answered the wrong file about half the time (consent_folder_grant_leaves_uncovered_asks_pending failed on the build server). The tests now pick each request by its file name. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
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.
Allowing a whole folder from a permission card (
allow_scope) used to leave sibling asks for paths inside that folder waiting for their own answers. In the specimen, two parallel reads were filed 8 ms apart, and allowing the folder on the first card left the second card waiting. Now, once a folder grant is stored, AFT withdraws every other live ask it truly covers: same session, same scope (owner, ref and epoch), same kind of access, and a path inside the folder. The withdrawn card leaves the phone, and its waiting call runs under the stored grant.If the user answered a covered card at the same moment, Cingulate's withdraw returns the settled record and that answer stands. Asks for other folders, other access kinds, other sessions or other scope epochs stay pending. One info log line per withdrawn ask names the covering ask, and logs only a hash of the folder path.
Withdraw vectors come from Cingulate tool-permission-v1 (04b7cbd). Tests: covered sibling settled and withdrawn; uncovered cases stay pending; the withdraw race keeps the recorded denial; the log line. The tests pick each consent request by file name, because parallel requests arrive in either order. 135 consent tests pass three times in a row on Linux; Windows target check passes.
Summary by cubic
Allowing a folder grant (
allow_scope) now settles and withdraws other open asks for paths inside that folder (same session, scope, and operation), so sibling cards no longer wait for a second answer. Asks for other folders, operations, sessions, or scope epochs stay pending. If a covered ask settled at the same moment, its recorded outcome stands. Each withdrawn ask logs one info line naming its covering ask, with only a hashed path.Written for commit b7145fd. Summary will update on new commits.