fix(permissions): drop the membership request when stepping back - #3178
Merged
Conversation
Back only cleared the selected user; it left the membership request in flight and did not advance the request counter, so nothing invalidated it. On rejection the guard still matched, and the error landed on the user step — reporting "Could not load users." over a user list that had loaded fine, with a Retry that re-ran the wrong request. Back now invalidates the in-flight request and clears the error and spinner it owns. The rejection path also checks the selected user, so it matches the success path rather than relying on the counter alone.
Console (appwrite/console)Project ID: Tip Each function runs in its own isolated container with custom environment variables |
ChiragAgg5k
approved these changes
Aug 21, 2026
Contributor
Greptile SummaryThis PR prevents an abandoned membership request from updating the permissions picker after the user returns to step one.
Confidence Score: 5/5The PR appears safe to merge, with no actionable regressions identified in the updated request lifecycle. The request counter invalidates abandoned work, both response paths verify request and user identity, and the guarded cleanup prevents stale requests from clearing newer loading state. Important Files Changed
Reviews (1): Last reviewed commit: "fix(permissions): drop the membership re..." | Re-trigger Greptile |
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.

Follow-up to #3177, which merged before this Greptile P1 was addressed. The finding was correct.
The path: on step two with a membership request in flight, hit Back.
clearUser()cleared the selected user but left the request live, and Back triggers no new request — solatestRequestnever advanced and nothing invalidated it. On rejection therequestId !== latestRequestguard still matched, soloadErrorwas set while the picker sat on step one. Result: "Could not load users." over a user list that had loaded fine, with a Retry wired to the wrong request.Fix:
clearUser()now advances the request counter and clears the error and spinner it owns, so stepping back abandons the request rather than leaving it able to report. The rejection path also checks the selected user, matching the success path instead of relying on the counter alone — that asymmetry is what Greptile flagged.check0 errors,lint0 errors, 265 unit tests,buildclean.