Skip to content

Preserve random draws across interview navigation - #280

Open
Ericko00o wants to merge 1 commit into
sysprog21:mainfrom
Ericko00o:feat/preserve-random-draw
Open

Ericko00o wants to merge 1 commit into
sysprog21:mainfrom
Ericko00o:feat/preserve-random-draw

Conversation

@Ericko00o

@Ericko00o Ericko00o commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Preserve an explicit random draw and the candidate's difficulty and duration choices when returning from an unfinished interview through Back, Leave, or Done. Capture the draw ticket and lobby snapshot when Start is pressed so picker changes during an awaited sign-in cannot replace the interview's selection. Reapply the captured choices after native browser form restoration. Clearing a topic filter returns to recommendations while retaining the explicit lobby choices.

Save a tab-local snapshot alongside the draw ticket for fresh lobby entries. Only the latest successfully persisted graded HIRE or NO_HIRE report may end that draw. Beginning a new save invalidates previous completion, so pending, rejected, and failed saves cannot reuse a retained older report. Interview URLs without a ticket cannot claim another draw, and unrelated report deletion or account-history merges retain the selection.

When sessionStorage is unavailable, a ticket-specific same-origin localStorage receipt records the current save outcome and must match the persisted report. Receipts from another tab cannot replace this draw's result. Read-only storage cannot establish a current completion and is treated conservatively. Browser Back uses history state when tab storage is blocked; a fresh lobby entry requires available tab storage to restore the snapshot. If neither completion store is usable, retain the draw instead of inferring success from old history.

Validation: all 237 targeted picker, lobby, draw-completion, and interview-lifecycle tests passed without failures or skips. The login-race and newer-failed-save cases failed before the fixes and passed afterward. Formatting, ESLint, commit-message validation, staged checks, and all 49 Git hooks checks passed. The full browser suite reported 1192 passed, 5 failed, and 3 skipped. The required scripts/test.sh gate was run but did not pass: Cargo was unavailable; wire-fixtures and recording-provision-check-tests encountered existing Windows limitations; the five browser failures were four Windows ESM path cases and one unavailable-server face check. Java and two built-server browser cases were skipped, and cargo-audit, actionlint, ruff, and shellcheck were unavailable.

Rebased onto main at 8394d54. This PR contains one navigation commit and preserves upstream source-display, interview retry settings, and voice controls.

Comment thread web/app.js
@jserv

jserv commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

@Ericko00o #256 merged on 2026-10-11, so the prerequisite this draft waits on is in main. Rebase onto main so only the navigation commit remains, then mark the pull request ready for review as your description plans. It and #285 (Strict mode) both edit web/app.js and web/interview.js, so expect a conflict whichever lands second.

@Ericko00o
Ericko00o force-pushed the feat/preserve-random-draw branch from ff67108 to 3bef5c8 Compare October 13, 2026 03:37
@Ericko00o
Ericko00o marked this pull request as ready for review October 13, 2026 03:38
cubic-dev-ai[bot]

This comment was marked as resolved.

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase latest main branch and resolve conflicts.

An unfinished interview should retain the draw and lobby choices taken
when Start was pressed, even when sign-in delays navigation. Restore
those choices across Back, Leave, and Done without letting later edits
replace the ticket. Only the latest successfully saved graded report
may end a draw; retained older reports cannot prove completion after a
failed save. Clearing a topic returns to recommendations.
@Ericko00o
Ericko00o force-pushed the feat/preserve-random-draw branch from 3bef5c8 to edecbee Compare October 14, 2026 11:01
@jserv
jserv requested review from ColtenOuO and alanhc October 14, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants