Skip to content

fix(dashboard): handle balance-stream errors instead of freezing the balance#675

Open
joshuakrueger-dfx wants to merge 1 commit into
RealUnitCH:developfrom
joshuakrueger-dfx:joshua/fix-657-p3-balance-onerror
Open

fix(dashboard): handle balance-stream errors instead of freezing the balance#675
joshuakrueger-dfx wants to merge 1 commit into
RealUnitCH:developfrom
joshuakrueger-dfx:joshua/fix-657-p3-balance-onerror

Conversation

@joshuakrueger-dfx
Copy link
Copy Markdown
Collaborator

Addresses Issue #657 — Part 3, finding #14.

Problem

BalanceCubit used watchBalance(...).listen(emit) with no onError — a stream error escaped as an unhandled async error and the balance silently froze with no recovery.

Fix

Add an onError handler that logs the failure. cancelOnError defaults to false, so the subscription stays alive and later balances still update the UI.

Tests (RED→GREEN, proven)

New regression: a addError on the stream must not fail as unhandled, and a balance pushed afterwards still updates the state — fails on the old code (verified), passes with the fix. Suite green (5/5), flutter analyze clean.

🤖 Big Brother fleet confirmed the defect (Design-Skeptic PASS); hand-finished by operator (fleet Inspector-cap-stopped). Ref #657.

…balance

BalanceCubit subscribed with watchBalance(...).listen(emit) and no onError, so
a stream error escaped as an unhandled async error and the balance silently
froze with no recovery. Add an onError handler that logs the failure; with
cancelOnError defaulting to false the subscription stays alive, so later
balances still update the UI.

Regression: test/screens/dashboard/balance_cubit_test.dart
("a stream error is handled ... and later balances still update")

Issue RealUnitCH#657 — Part 3, finding RealUnitCH#14.
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.

1 participant