Repository navigation
test(grants): a pending revoke error and confirm do not survive a 403 - #3281
Merged
Merged
Conversation
The existing forbidden-reload test revoked successfully, so both states were already clear before the 403 and it passed with either clear removed. This one fails the revoke first, loses access, gets it back, and checks neither the error nor the held confirm returns. Removing either clear fails it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015AKgpMD6Qh13f7fj6mbGT3
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Grant state reset coverage frontend/src/v2/__tests__/V2AgentRuntimeGrants.test.tsx |
The test checks that a failed revoke error and confirmation do not remain after a 403 reload and later successful reload. It also checks that the restored Revoke control is enabled. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related PRs
- Team-Commonly/commonly#3248: Introduced the connector-grants UI and its load, revoke, error, and confirmation states.
- Team-Commonly/commonly#3272: Changed grants-load 403 handling to clear prior load state.
- Team-Commonly/commonly#2527: Introduced the agent runtime and connector-grants component, including grant loading and revoke states.
Merge Risk: 
Minimal · up to 6a456
-
No actionable merge-blocking risk was identified in the regression test.
Pre-merge checks: 
4
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
lilyshen0722
commented
Nov 1, 2026
lilyshen0722
left a comment
Contributor
Author
There was a problem hiding this comment.
Review at 6a456ae, tests only.
- It reaches the 403 branch. A new token rebuilds
useV2Api's headers and thenget,apiandload, which reruns the effect. The "Owner and admins only" assertion confirms the 403 path ran. - It fails without each clear. Removing
setRevokeError('')brings the "Could not revoke the grant." alert back. RemovingsetConfirmGrantId(null)brings "Yes, revoke it" back. Both checked on a copy, with the original restored and checksum-matched. - It isn't flaky. Three repeated runs pass, and the full file passes, 29 of 29. Every await is a
findBy*.beforeEachresets the axios mocks, so nothing leaks into later tests.
GATE: PASS
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 CodeRabbit's note on #3276. The forbidden-reload test there revoked successfully, so the revoke error and the held confirm were already clear before the 403 reload. It would have passed with either clear removed.
The new test fails the revoke so both stay up, loses access (a 403 reload), then gets it back (a clean reload). It checks that the list returns with no alert and no held confirm. A new auth token recreates the api client and reruns the load, the way a session change would.
Reverse-verified: removing
setRevokeError('')orsetConfirmGrantId(null)from the 403 branch fails it.V2AgentRuntimeGrants: 29 of 29 pass.🤖 Generated with Claude Code
https://claude.ai/code/session_015AKgpMD6Qh13f7fj6mbGT3