principal pending snapshot: index hook-routed requests by session so a grant's read cost ignores other sessions
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
- Domain
- backend, performance
Research direction
Start in packages/server/src/principal-pending-permissions.js, especially collectPendingPermissions and the hook-routed read. Trace where pending requests are inserted and removed on answer, timeout, abort, drain, and session teardown, then find the related tests. Done means authorized snapshots touch only their sessions' entries and tests show the index stays aligned with the store across each removal path.
Written by the indexing model from the issue text.
Description
Context
Identified during review of PR #9127 (S4 of #9112, closes #9119).
Location: packages/server/src/principal-pending-permissions.js (collectPendingPermissions, the hook-routed read)
Description
A principal's principal_pending_permissions snapshot reads the hook-routed store by iterating every entry of pendingPermissions and looking up its owner in permissionSessionMap.
- With an empty authorized set the scan is skipped (#9127).
- With a non-empty grant it is still O(total hook entries across all sessions).
So the work behind a granted session's snapshot depends on how many hook prompts are pending in sessions the principal cannot see. No other session's content is read or returned; only the cost depends on it.
Repro:
- Grant session
s1. - Put 1,000 hook entries owned by an ungranted session
s2in the store. - Request a snapshot for
s1.
The reply is empty, but all 1,000 owners are consulted.
Acceptance Criteria
- The hook-routed pipeline keeps a session-to-pending-request index, maintained on insertion and on every removal path (answer, timeout, abort, drain, session teardown).
- The snapshot iterates only the authorized sessions' entries.
- A test with a non-empty grant and an access trap on unrelated store entries proves no unrelated entry is touched.
- A test proves the index cannot drift from the store, including after the removal paths.
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 1
- Avg merge
- 2h 3m
- Merged PRs (30d)
- 333
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from blamechris/chroxy
-
from-review tech-debt testing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
blamechris/chroxy#9520 ·
Maintainers usually reply within 1 day
-
priority: low server
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
blamechris/chroxy#9340 ·
Maintainers usually reply within 1 day
-
documentation from-review
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
blamechris/chroxy#9237 ·
Maintainers usually reply within 1 day
-
agent-control client: notify() docstring should say the outbound gate applies only in principal modeOpenenhancement from-review
Difficulty 1/5 Under an hour Newbie friendliness 80/100
blamechris/chroxy#9227 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blamechris/chroxy#9108 ·
Maintainers usually reply within 1 day
All issues in blamechris/chroxy
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Use one constant for the 10,000-character input limitPossibly taken @NginxL claimed this today. Opengood first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aniru-dh21/snap-validate#51 ·
Maintainers usually reply within 1 day
-
Documentation pleaseOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area/host bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Fei2411/DeepSeek-Bot#3190 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days