This repository was archived by the owner on Apr 16, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Add cleanup indexes for ASB retention paths #66
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| CREATE INDEX IF NOT EXISTS idx_sessions_state_expires | ||
| ON sessions (state, expires_at); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_grants_session_id | ||
| ON grants (session_id); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_grants_state_expires | ||
| ON grants (state, expires_at); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_approvals_state_expires | ||
| ON approvals (state, expires_at); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_artifacts_state_expires | ||
| ON artifacts (state, expires_at); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_audit_events_created_at | ||
| ON audit_events (created_at); |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silent truncation may leave grants unrevoked on session cleanup
Low Severity
ListGrantsBySessionnow silently caps results at 10,000, but both callers (expireSessionandRevokeSession) assume they receive all grants for the session. InexpireSession, the session is marked expired even when not all grants were processed, and since the session is no longeractive, subsequent cleanup runs won't re-process it — leaving orphaned active grants. InRevokeSession, there's no retry mechanism at all. No error or warning is returned when the limit is reached.Reviewed by Cursor Bugbot for commit 9805c67. Configure here.