Repository navigation
✨ Apply consent to renderer execution contexts - #235
rgaignault wants to merge 6 commits into
Conversation
|
@codex review |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Stale comment
PR Review — Quality: 3.5 / 5 · Review load: Focused (~30–45min)
The consent handling for renderer execution contexts is in good shape and needs one round before merge. Open windows split on granted/pending, stop while refused, and resume without reviving a crashed or destroyed renderer, matching
MainProcessContext. A renderer that becomes active during the sessionless gap still loses the granted period's terminal update when consent changes. This stays dormant until something callsTrackingConsentManager.update— this branch does not export that — so the rollout risk is that invariant, not a change to today's default.Customer impact: High — With consent left at its initial
grantedvalue, renderer contexts behave as they do today. Once consent is updated on this manager, refusing it stops renderer execution-context reporting while the window stays open, and the last granted update is meant to stay in authorized storage.
Concern Renderer execution-context lifetime across consent, session expiry, and crash reload Risky Quality — 3.5: The split, refusal, and resume paths are correct for a window already tracked in an active session, including crash reload and a synchronous renew after expiry. The tests match those paths and the architecture note matches the diff. One manager subscription,
closePeriod, and the same early returnMainProcessContextuses is a sound shape. What holds this below 5.0 is the sessionless gap: that early return assumes the previous period was already closed, and nothing covers a renderer that starts while the session is expired.Review load — Focused (~30–45min): One risky boundary, the renderer execution-context lifetime, together with the consent and session ordering it depends on. The docs and unit tests sit on that same boundary.
Findings
- [Minor] Gap-window consent change drops the granted terminal update —
RendererProcessContexts.ts:295returns onceSESSION_RENEWhas replaced a still-active gap context, andregister()closes that context without emitting it. Emit the terminal update fromregister()before starting the replacement.Sent by Cursor Automation: electron-sdk reviews
There was a problem hiding this comment.
Stale comment
PR Review — Quality: 5.0 / 5 · Review load: Focused (~15–45min)
Renderer execution contexts now follow consent the same way the main process already does: a granted or pending change splits the open period, refusal stops context events and heartbeats, and a crashed or destroyed window stays closed when tracking resumes. Session renewal runs before the consent handler and the early return keeps that from rotating the window twice; the reload name stays unresolved until
dom-readyeven when consent or the session changes mid-reload. Approve. GitLab integration was still running when this was posted.Customer impact: High — Execution contexts stay off unless
enableExecutionContextis set, and consent still starts as granted. When both are in use, an open renderer window splits at each consent boundary and stops reporting while consent is refused.
Concern Renderer execution contexts follow consent, including resume and reload naming Risky Quality — 5.0: The split, the refusal pause, and the crash or destroy veto are correct, including when session renewal has already started the new period. Tests cover delayed init, refusal, reload naming, and crash-after-expiry in proportion to that lifecycle. The architecture note matches the pause and the naming rule. The shape matches
MainProcessContextandViewCollection, so the next consent change has the same boundary to follow.Review load — Focused (~15–45min): One risky boundary: renderer window lifetime against consent and session renewal, including the reload name guard. The doc and test updates sit on that same path.
Sent by Cursor Automation: electron-sdk reviews
There was a problem hiding this comment.
Stale comment
PR Review — Quality: 3.5 / 5 · Review load: Focused (~30–45min)
The consent handling for renderer execution contexts is in good shape and needs one round before merge. Open windows split on granted/pending, stop while refused, and resume without reviving a crashed or destroyed renderer, matching
MainProcessContext. A renderer that becomes active during the sessionless gap still loses the granted period's terminal update when consent changes. This stays dormant until something callsTrackingConsentManager.update— this branch does not export that — so the rollout risk is that invariant, not a change to today's default.Customer impact: High — With consent left at its initial
grantedvalue, renderer contexts behave as they do today. Once consent is updated on this manager, refusing it stops renderer execution-context reporting while the window stays open, and the last granted update is meant to stay in authorized storage.
Concern Renderer execution-context lifetime across consent, session expiry, and crash reload Risky Quality — 3.5: The split, refusal, and resume paths are correct for a window already tracked in an active session, including crash reload and a synchronous renew after expiry. The tests match those paths and the architecture note matches the diff. One manager subscription,
closePeriod, and the same early returnMainProcessContextuses is a sound shape. What holds this below 5.0 is the sessionless gap: that early return assumes the previous period was already closed, and nothing covers a renderer that starts while the session is expired.Review load — Focused (~30–45min): One risky boundary, the renderer execution-context lifetime, together with the consent and session ordering it depends on. The docs and unit tests sit on that same boundary.
Findings
- [Minor] Gap-window consent change drops the granted terminal update —
RendererProcessContexts.ts:295returns onceSESSION_RENEWhas replaced a still-active gap context, andregister()closes that context without emitting it. Emit the terminal update fromregister()before starting the replacement.Sent by Cursor Automation: electron-sdk reviews
There was a problem hiding this comment.
PR Review — Quality: 5.0 / 5 · Review load: Focused (~30min–45min)
Quality is 5.0. I would approve and merge this. Renderer execution contexts follow the same consent rules as the main process: a consent change closes the current period and, when the window is still alive and consent is granted or pending, starts the next period at that same timestamp. Listeners stay installed while consent is refused, so a later grant resumes a live page and leaves a crashed renderer stopped until its own reload. Navigation readiness sits on the window manager, so a consent or session change during a reload cannot freeze the pre-crash URL. enableExecutionContext still defaults off and consent still starts granted, so this reporting change applies only after both are turned on.
Customer impact: High — With execution contexts left disabled, or with consent left at its initial granted state, renderer reporting is unchanged. Enabling execution contexts and then refusing consent stops context events and heartbeats for windows that stay open; a granted period's final update stays authorized, and a crash is not revived by the grant alone.
| Concern | |
|---|---|
| Renderer execution-context consent lifecycle | Risky |
Quality — 5.0: The consent, session, crash, and reload paths agree, including renew-before-consent so a period is not opened twice. The unit tests cover refusal, pending and granted splits, windows created while denied, and a reload whose name stays unresolved across those boundaries. The architecture notes match that behavior. The shape is sound: it matches MainProcessContext, where a session renewal may already have opened the new period and the consent handler leaves that period in place.
Review load — Focused (~30min–45min): One risky boundary: renderer context lifetime at consent changes, read together with session expiry and crash revival. The tests and architecture note are that same boundary.
Sent by Cursor Automation: electron-sdk reviews
…-renderer-consent
…-renderer-consent
…-renderer-consent


Motivation
Keep renderer execution-context durations and identities consistent with consent while an Electron window remains open. Builds on the session and main-process lifecycle changes in #234.
Changes
These are Electron window execution contexts. Browser SDK event admission and replay collection are unchanged.
Test instructions
yarn exec vitest run --maxWorkers=2— 1,374 tests passed across the complete stack.Checklist