Skip to content

Conversation

@jvsena42
Copy link
Member

@jvsena42 jvsena42 commented Feb 3, 2026

Fixes #608

This PR adds network error resilience to the transfer-to-spending polling mechanism by distinguishing between transient network failures and permanent order errors.

Description

  • Uses .fold() instead of .getOrNull() to properly handle Result failures
  • Implements a retry mechanism that tolerates up to 5 consecutive network errors before giving up
  • Resets the error counter on successful fetches, allowing recovery from intermittent issues
  • Preserves immediate exit behavior for permanent failures (order not found, order expired)

Preview

N/A - No UI changes

QA Notes

1. Normal transfer flow (regression)

  1. Start a transfer to spending
  2. Verify the setup steps progress (0 → 1 → 2 → 3)
  3. Confirm the channel opens successfully

2. Network error recovery

  1. Start a transfer to spending
  2. Enable airplane mode briefly during polling
  3. Disable airplane mode before 12.5 seconds (5 retries × 2.5s)
  4. Verify polling resumes and completes successfully

3. Persistent network failure

  1. Start a transfer to spending
  2. Enable airplane mode and keep it enabled
  3. After ~12.5 seconds, verify the transfer fails gracefully with appropriate logging

@jvsena42 jvsena42 self-assigned this Feb 3, 2026
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.

Spending balance remains 0 after opening the channel from the app, despite transfer to spending confirmed (Android)

2 participants