Skip to content

Warn before leaving until report is saved - #250

Merged
jserv merged 1 commit into
sysprog21:mainfrom
davidtsai15:fix/interview-lifecycle-warning
Oct 8, 2026
Merged

jserv merged 1 commit into
sysprog21:mainfrom
davidtsai15:fix/interview-lifecycle-warning

Conversation

@davidtsai15

@davidtsai15 davidtsai15 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Timed interviews currently allow accidental refreshes or navigation before the report is safely persisted.

This change keeps the native beforeunload guard active from the timed interview start until either the local or account report copy has been saved. LiveKit's automatic page-leave disconnect is disabled because it runs before the candidate chooses whether to stay, so room cleanup now waits for pagehide.

Tests cover the interview lifecycle, report persistence results, listener cleanup, and LiveKit page-leave behavior. The credential-free test gate passes locally, including all 936 browser tests with no failures or skips.

Closes #243


Summary by cubic

Warns before leaving a timed interview until a report copy is saved, so candidates can't lose an unsaved report by refreshing or navigating away.

  • LiveKit's automatic page-leave disconnect is disabled; room cleanup now waits for pagehide so it doesn't run before the candidate chooses to stay.
  • The warning turns on when the timed interview starts and turns off only after a local or account report copy is persisted.
  • An explicit Leave button disables the warning before tearing down the session.
  • When overlapping report saves finish out of order, only the newest save can release the warning.

Closes #243.

Written for commit f9c83f2. Summary will update on new commits.

View guided diff

cubic-dev-ai[bot]

This comment was marked as resolved.

Comment thread web/interview.js
Comment thread web/interview.js Outdated
@jserv
jserv requested review from ColtenOuO and alanhc October 7, 2026 04:10
@davidtsai15
davidtsai15 force-pushed the fix/interview-lifecycle-warning branch from a14db9c to aef6158 Compare October 7, 2026 07:42

@ColtenOuO ColtenOuO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please squash your commits.

Addressing review comments does not require a separate commit.

A timed interview can be lost to refresh or navigation before its report
reaches Past attempts. LiveKit's page-leave hook also disconnects before
the candidate can choose Stay, so wait for pagehide and keep the warning
until a saved report can be reopened.
@davidtsai15
davidtsai15 force-pushed the fix/interview-lifecycle-warning branch from aef6158 to f9c83f2 Compare October 8, 2026 07:08
@davidtsai15

Copy link
Copy Markdown
Contributor Author

Squashed the review-fix commit into the original commit. The PR now contains a single commit.

@ColtenOuO ColtenOuO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks!

@jserv
jserv merged commit e7e1067 into sysprog21:main Oct 8, 2026
6 checks passed
@jserv

jserv commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Thank @davidtsai15 for contributing!

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.

Warn before leaving an interview session before its report is safely saved

3 participants