Skip to content

Fix/balance shows zero after send - #2

Merged
soumen0818 merged 2 commits into
mainfrom
fix/balance-shows-zero-after-send
Aug 29, 2026
Merged

Fix/balance shows zero after send#2
soumen0818 merged 2 commits into
mainfrom
fix/balance-shows-zero-after-send

Conversation

@soumen0818

Copy link
Copy Markdown
Owner

This pull request improves the accuracy and clarity of balance reporting throughout the application, ensuring users always see the total funds they own (including pending/unfolded change) rather than only the immediately spendable amount. This addresses confusion where balances temporarily appeared as zero after sending funds, even though the user still owned most of their money. The changes also enhance user feedback reporting and add public backend health endpoints for easier review.

Balance reporting improvements:

  • Changed all balance displays in the mobile app (HomeScreen, DepositScreen, ProfileScreen) to show the total owned funds (spendable + pending), with clear explanations and UI cues for pending funds. This prevents the balance from appearing to "vanish" immediately after a send. (mobile/src/features/home.tsx [1] mobile/src/app/deposit.tsx [2] mobile/src/features/profile.tsx [3]
  • Updated the Money type and useMoney hook to include a total field, and clarified in comments and documentation when to use total vs spendable for display and gating send actions. (mobile/src/hooks/use-money.ts [1] [2] [3] [4]
  • On the Send screen, clarified the label to "Available to send" and ensured only spendable is used for send gating, with UI explanations for the difference between owned and available funds. (mobile/src/app/send.tsx mobile/src/app/send.tsxR554-R561)

User feedback and documentation updates:

  • Updated user feedback reporting in README.md to reflect two tester reports, how both were addressed, and improved the ratings table to show scores per respondent and averages. Added explanations for the impact of the previous balance bug on user confidence. (README.md README.mdL249-R293)
  • Updated the count of meaningful commits in the project checklist. (README.md README.mdL163-R163)
  • Added a third public transaction to the list of verifiable testnet transfers, including one initiated by a tester. (README.md README.mdR310-R314)

Backend health endpoints:

  • Documented three new public backend health endpoints (/healthz, /readyz, /pool/status) in the README.md, with explanations of their purposes and example responses, to facilitate independent reviewer verification of backend status. (README.md README.mdR225-R243)

These changes collectively improve user trust, make the app's behavior more intuitive, and make the system easier to review and monitor.

soumen0818 and others added 2 commits August 30, 2026 01:45
Reported by a tester: "After transection the balance show zero and few
seconds latter balance appears."

A send marks the input note spent and writes the change back with
leafIndex: null, because the change genuinely cannot move until the
folder runs. spendableNotes() filters on leafIndex !== null, so the
change counted as *pending* — and the Home headline rendered
money.spendable. Paying 100 out of 1000 therefore showed 0.00 while the
user still owned 900, for a full fold cycle.

Recording the change note (an earlier fix) stopped the money vanishing
from the data. It did not stop the headline reading the one number that
excluded it.

Money now carries `total` (spendable + pending), and the two are used
for different questions:

  - display `total`   — Home, Profile, Add money: "what do I have"
  - gate on `spendable` — every Send affordability check: "what can
    leave right now"

Showing pending money in the total is not the same as offering it: a
note that is not yet a leaf still cannot be spent, and the Send screen
still refuses it, so the refusal never moves from the screen to the
contract.

Labels follow the numbers — Home is "Private balance" rather than
"Available balance", and Send says "Available to send" — so a larger
figure on Home than on Send is self-explaining.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 925a060f-aaff-4608-b9da-0cc36c99558c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@soumen0818
soumen0818 merged commit efeadb4 into main Aug 29, 2026
2 checks passed
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