fix: stop "subjects have already been set" during pre-checkin - #3
Merged
Conversation
Confirming subject selection failed for anyone who used the back button. base:selectSubjects wrote CheckinSubject rows but its onStepRollback was an empty stub, so goBack deleted the step data and left the rows behind. On the re-run, setSubjects saw existing rows and threw. The pre-checkin flow renders a back button on every screen and has two informational steps right after subject selection, so this was easy to hit. - selectSubjects: clear subjects on rollback instead of no-op. - setSubjects: replace the set in a transaction rather than throwing. Resolves the TODO there. Safe because nothing downstream of subject selection has run yet, and it also unsticks sessions that died between setSubjects and setCompleted -- those hit the error on every retry via the resume path. - SelectSubjectScreen: block double submits, which could otherwise put two confirmSubjects calls in flight before the step advanced. Also guard goBack against completed/aborted sessions. Rollback hooks undo real side effects, and step:goBack can be sent directly (admin debug panel) even though the kiosk hides the button once the session finishes. undoCheckin stays the one way to reverse a finished check-in. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ScoutButton has a `loading` prop that renders a centered spinner and hides the label, and it already implies disabled (the render sets the underlying disabled attribute and suppresses the click), so it replaces the extra disabled condition. `disabled` stays for the empty-selection case, where there is nothing to communicate beyond "not available". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Confirming subject selection failed for anyone who used the back button. base:selectSubjects wrote CheckinSubject rows but its onStepRollback was an empty stub, so goBack deleted the step data and left the rows behind. On the re-run, setSubjects saw existing rows and threw. The pre-checkin flow renders a back button on every screen and has two informational steps right after subject selection, so this was easy to hit.
Also guard goBack against completed/aborted sessions. Rollback hooks undo real side effects, and step:goBack can be sent directly (admin debug panel) even though the kiosk hides the button once the session finishes. undoCheckin stays the one way to reverse a finished check-in.