Improve session banner, unroll status, and on-chain timeout claims - #405
Merged
Conversation
…target. The UI was inferring unroll type from initiator and leftover numbers, and it showed the current potato state even when the spendable unroll was one behind.
A finished on-chain move still needs its timeout claim, but the UI only said Finishing. WASM now emits wait vs spend so the hand bar can say Finalizing waiting for timeout or Finalizing spending.
Stay on the native prompt no longer disconnects the hub. Closing the owner tab clears its lease so the next visit is not treated as a takeover.
Classify the landed unroll from the spend conditions in WASM. A hash we never signed or a conditions mismatch stays unrecoverable instead of falling back to timeout because some historical record exists.
Keep constructor initiator except on preempt, and fold duplicated shutdown/unroll watch helpers so the spend phase does not carry a second race flag or an always-true preempting bit.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 611b872. Configure here.
Old mid-unroll v12 records cannot decode the new semantic_phase names; discard them under the alpha no-migration policy instead of adding aliases.
matt-o-how
approved these changes
Aug 18, 2026
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.

Summary
semanticPhase+unrollInitiator) and render them with exhaustive JS copy maps, including the potato after the channel state number.Test plan
./ct.shNote
Medium Risk
Changes span on-chain unroll classification, timeout-claim registration, and session persistence (v13); UI is mostly display but incorrect spend handling could affect channel resolution.
Overview
Connectivity UX moves session mode off the tabs: Wallet/Hub/Game show link vs broken-chain emojis for pipe health only; degraded peer pings show on the game dashboard banner (yellow rail + “Peer pings look stuck”), not on tab colors. The session dashboard adds a left banner rail (
idle/playing/pings-bad/on-chain/ended).WASM → UI contract expands
ChannelStatuswithstate_number, unroll state numbers, and renamed semantic phases (unrolling,finding_state,finishing_waiting_timeout,finishing_spending, etc.). Dashboard copy maps those phases plusunroll_initiatorto labels like “Finishing opponent unroll” and preempt detail strings. Terminal finished games get distinct on-chain statuses (finishing-waiting-timeout/finishing-spending) andGameFinishTimeouttimeout-claim semantics.On-chain safety:
channel_coin_spentno longer branches on “who spent”; unsigned or conditions-mismatch spends error at parse time instead of falling back to timeout.classify_unrollno longer widens parse failures to “wait for timeout.”Persistence bumps envelope schema to v13 (v12 deleted per alpha policy). Shared
integersToBigIntnormalizes WASM/RPC integer boundaries.Tab lifecycle:
beforeunloadwarns on live off-chain/on-chain sessions; hub disconnect and lease release run onpagehideso staying on the page after a warning does not drop the hub.releaseLeaseIfOwnerclears the active-tab lease when the owning tab actually closes.Reviewed by Cursor Bugbot for commit 96964b4. Bugbot is set up for automated code reviews on this repo. Configure here.