Repository navigation
fix(flashcard): name a Cashu card's unit at once from what the mint named before - #752
Merged
Merged
Conversation
…amed before A tap showed the card at once, but its balance as "· unit unknown" until forge's keyset list came back: the list was cached in memory only, so after a cold start every first tap waited on the network. A balance-moving card operation (a top-up load) did the same. A keyset's unit never changes, so the flashcardV2 slice now keeps the units the mint names (`keysetUnits`, signed-in reads only; logout clears them). A read, or an operation's new split, whose keysets are all named is labelled on its first render; the mint is still asked, and a card holding a keyset it has not named waits for its answer as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
islandbitcoin
force-pushed
the
jabariennis/flashcard-v2-known-units
branch
from
October 4, 2026 23:04
11fb81c to
6b796b1
Compare
…card from known units Review fixes for #752: - A tap labelled from `keysetUnits` now sets the card record's unit too, as the card-operation path already did. `cardSeen` clears that unit when the balance moved, so after a spend elsewhere the home row said "unit unknown" beside a card screen that named the unit, until the mint answered (never, offline). - Tests: the record is named at once after a spend while the mint is slow; a card holding one named and one unnamed keyset still waits on the mint (`every`, not `some`); a stale mint answer's units are still kept. - Docs: `CashuCardState.unitTotals`, `resolveCashuUnits`, `KnownCard.unit` and `cardUnitResolved` now describe labelling from `keysetUnits`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d from known units Review fixes for #752: - A tap the mint cannot label leaves the record's unit as `cardSeen` left it. New spec beside "the record's unit alone": a record named on a build before `keysetUnits` keeps its unit at an unchanged balance while the mint is unreachable, so the home row does not fall back to "500 · unit unknown". It fails if the tap path dispatches an unlabelled unit as the op path does; the guard's comment now says why it does not. - A card holding sat and usd names no single unit on its record, on a tap and after an op that loads the second unit, both labelled at once from `keysetUnits` (`soleUnit`, never the first unit). `makeSplitCard` takes a `loadKeyset` for the op case. - Docs: `balanceLines` and the op spec's header now say a split whose keysets the mint named before is labelled at once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
A tap shows the Cashu card at once, but its balance read "· unit unknown" until forge's keyset list came back. That list was cached in memory only, so after a cold start every first tap waited on the network. A card operation that moves the balance, such as a top-up load, did the same. Found during the 2026-10-02 device test.
Fix: a keyset's unit never changes, so the
flashcardV2slice now keeps the units the mint names (keysetUnits).Tests:
Each fails when the behaviour it names is removed. Full suite: 154 suites, 1,826 tests.
🤖 Generated with Claude Code