fix: drop stale turn-end approvals and nil-panic guards - #81
Merged
Merged
Conversation
JSON-null session stores no longer panic on Set, a reconnect hook that returns (nil, nil) no longer crashes the give-up path, and done/error drop the approval form the same way disconnect already does so a dead gate cannot capture the keyboard. Co-authored-by: admin <admin@21no.de>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bodek | 02aabc9 | Commit Preview URL Branch Preview URL |
Sep 05 2026, 05:16 PM |
jkyberneees
marked this pull request as ready for review
September 5, 2026 17:19
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.
What
Three crash/stuck-UI bugs found in a self-improvement pass, validated with a reviewer, pinned RED-first, then fixed.
tokens.Openpanics on JSONnull.encoding/jsonunmarshalsnullinto a nil map.Setthen panics (assignment to entry in nil map). Corrupt JSON was already tolerated;nullis valid JSON so that path never ran. Open now re-inits an empty map and keeps the persist path.Reconnect give-up panics on
(nil, nil). Success already requires a live client (err == nil && cl != nil). A hook that returns neither a client nor an error exhausted the retry budget, thenmsg.err.Error()nil-deref'd. The give-up note now uses a"no client"fallback.done/errorleave the approval form armed. Disconnect already drops pending approvals so they cannot capture the keyboard after the socket dies. Turn-end did not: after the engine finishes (timeout, cancel, success) the dead form still owned Enter/Esc,answer()wouldSendApprovalfor an abandoned id, and a queued prompt could start while the gate still captured keys.doneanderrornow clear the queue the same way disconnect does.Tests
RED-first, then green:
TestOpenWithJSONNull—Setafter Open ofnullmust not panic; value persistsTestReconnectNilClientNoPanic— last-attempt(nil, nil)must not panic; statusdisconnectedTestTurnEndClearsStaleApprovals—done/error/ cancel-as-error drop the form, deadlines, and A/D footer hintsmake fmt/vet/lint0 issues.make testrace green across all packages. GitHub CI (8 checks) green.Expert review of the production diffs: APPROVE.
Release
Shipped as v1.4.1 (GoReleaser succeeded). Squash-merge into
mainwhen ready — this token cannot merge protectedmain.