Skip to content

fix: show funding warning when light-mode wallet has no xDAI#32

Open
crtahlin wants to merge 1 commit into
GasperX93:masterfrom
crtahlin:fix/light-mode-funding-warning
Open

fix: show funding warning when light-mode wallet has no xDAI#32
crtahlin wants to merge 1 commit into
GasperX93:masterfrom
crtahlin:fix/light-mode-funding-warning

Conversation

@crtahlin
Copy link
Copy Markdown
Collaborator

Summary

  • Funding monitor now runs in both ultra-light and light modes. Previously it skipped entirely in light mode (if (currentMode === 'light') return), so when a node had swap-enable: true but an empty wallet, Bee crash-looped with no UI indication — the user saw "Starting Bee node…" forever.
  • New needsFunding flag on /status endpoint. In light mode, the monitor polls wallet balance and sets this flag when xDAI is below threshold.
  • UI shows funding banner when needsFunding is true, bypassing the startup overlay that was previously hiding it.

Closes crtahlin#1

Changed files

File Change
src/funding-monitor.ts Remove early return for light mode; add needsFunding state + getNeedsFunding() export; in light mode set flag based on wallet balance
src/status.ts Add needsFunding: boolean to Status interface, sourced from getNeedsFunding()
ui/src/api/client.ts Add needsFunding?: boolean to frontend Status type
ui/src/components/Layout.tsx Include status?.needsFunding in funding warning condition; bypass startup overlay when needsFunding is true
CLAUDE.md Update docs for funding-monitor and status modules
test/funding-monitor.spec.ts New: tests for detectMode(), getNeedsFunding(), startMonitorIfNeeded()
test/status.spec.ts New: tests for getStatus() with/without needsFunding

Test plan

  • Backend unit tests pass (33 tests)
  • UI unit tests pass (28 tests)
  • TypeScript type check clean
  • ESLint clean (0 errors)
  • Manual test: start Nook with light-mode config + empty wallet → funding banner appears after ~15s
  • Manual test: fund the wallet → banner disappears, Bee starts normally

AI-assisted implementation.

The funding monitor previously skipped entirely in light mode, so when a
node had swap-enable: true but an empty wallet, Bee would crash-loop with
no UI indication. The user saw "Starting Bee node…" forever.

- Run funding monitor in both ultra-light and light modes
- Expose needsFunding flag on /status when light-mode wallet is unfunded
- Show funding banner in UI when needsFunding is true, bypassing the
  startup overlay that was hiding it
- Add tests for funding-monitor and status modules

AI-assisted implementation.

Closes #1
@crtahlin crtahlin requested a review from GasperX93 as a code owner April 20, 2026 08:56
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.

Funding warning not shown when light-mode node has no xDAI

1 participant