fix: crash when returning to foreground#875
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
Can you also please fix the issue with the transition from Spending to Auto always showing when there are lightning channel the moment user opens the Receive Sheet?! Thx in advance 🙏🏻 |
Nvm I opened a new issue to be fixed in a separate PR: |
# Conflicts: # CHANGELOG.md
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
ovitrif
left a comment
There was a problem hiding this comment.
tAck.
Testing scenario is a bit more complex than described in PR description. I couldn't find a way to "force" the app to shutdown the node when it get backgrounded, even with notifications disabled (which I would expect to mean the FG service doesn't work).
So instead, I used the lsp skill (from my local branch) to close the channel via BT regtest, while the app was in BG.
Upon returning, got this 🎉
Fixes #871
This PR:
IndexOutOfBoundsException) when returning the app to the foreground on the Receive screenDescription
When the app goes to the background, the Lightning node stops and channels become unavailable. On return, the AUTO tab is removed from visible tabs but
selectedTabstill references it, causing an index of -1 to be passed to the tab row — triggering the crash.The fix resets the selected tab when it's no longer in the visible tabs list and adds a defensive index clamp in the tab row component. Additionally, the Spending tab now returns an empty invoice when the node is not running, showing the QR placeholder loading state instead of a stale bolt11 invoice.
Preview
bg-qr-code.webm
QA Notes
Note: only happens when FG service is disabled