fix(display): allow browser sessions to take control #1832
Reference in New Issue
Block a user
Delete Branch "fix/display-control-browser-session"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Root-cause not symptom
The display takeover endpoint trusted AdminAuth for the browser request but
displayControlActorhad no stable actor for verified control-plane browser sessions, so the handler rejected real Canvas clicks with 403 even though viewing the Display tab was authenticated.Comprehensive testing performed
cp_session_actorand does not expose the raw cookie.Local-postgres E2E run
N/A: this change does not add or migrate schema. The DB-facing code path is covered with sqlmock handler tests for the exact
workspace_display_control_locksupsert behavior.Staging-smoke verified or pending
Pending post-merge deploy verification. PR CI already includes E2E Staging SaaS and Canvas/staging checks for the head SHA; production canary
/buildinfoplus a manual browser retry of Take control are the final release checks.Five-Axis review walked
No backwards-compat shim / dead code added
No compatibility shim or dead code added. The change completes the existing intended browser-session auth path for Display control.
Memory/saved-feedback consulted
Used current repo evidence and prior workspace-compute context from session continuity; no additional saved-memory file lookup was needed for this narrow production bug.
Tests
go test ./internal/handlers -run 'TestWorkspaceDisplayControl'go test ./internal/middleware -run 'TestVerifiedCPSession|TestAdminAuth'npx eslint src/components/tabs/DisplayTab.tsx --quietnpm test -- --run src/components/tabs/__tests__/DisplayTab.test.tsxgit diff --checkQA review approved. Verified the changed DisplayTab flow and backend regression coverage for browser-session display control acquisition. Local evidence from author branch: DisplayTab vitest passed, eslint passed, handler display-control tests passed, middleware AdminAuth/session tests passed.
QA review approved. Verified the changed DisplayTab flow and backend regression coverage for browser-session display control acquisition. Local evidence from author branch: DisplayTab vitest passed, eslint passed, handler display-control tests passed, middleware AdminAuth/session tests passed.
Security review approved. Static review: no new dependencies, no secret-shaped literals in changed files, CP session actor is derived only after VerifiedCPSession succeeds, and the stored controller id is a tenant-scoped hash rather than the raw cookie.
LGTM
5-axis review on (fix(display): allow browser sessions to take control):
Correctness: APPROVED. Stable hashed controller actor set on AdminAuth for verified browser sessions; Display tab reacquires session URLs for user locks on reload. Logic is sound.
Robustness: APPROVED. Stable hash prevents actor reuse attacks; session reacquisition is conditional on existing user locks.
Performance: APPROVED. No additional DB writes or queries introduced.
Security: APPROVED. Verification gated behind AdminAuth; controller actor is deterministically derived, not arbitrary. Browser session control surface is limited.
Compatibility: APPROVED. New behavior additive; existing sessions unaffected.
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack root-cause
/sop-ack five-axis-review
/sop-ack no-backwards-compat
/sop-ack memory-consulted
Engineering ack: DB write path is covered by sqlmock because this PR has no schema change; staging validation is represented by PR E2E plus post-merge canary; root cause is the missing browser-session actor at the display-control boundary; no compatibility shim or dead code was added.
/sop-ack comprehensive-testing
QA ack: regression coverage covers the browser-session Display takeover failure, handler lock acquisition, and DisplayTab take/release state.
Please review
Please review