Skip to content

Offline mode#285

Open
Sosthene00 wants to merge 11 commits intodevfrom
offline_mode
Open

Offline mode#285
Sosthene00 wants to merge 11 commits intodevfrom
offline_mode

Conversation

@Sosthene00
Copy link
Collaborator

@Sosthene00 Sosthene00 commented Feb 5, 2026

Proposal to better handle network issues/unreachable external services on wallet creation/restoration. For context current behavior is to fail right away in case we can't reach blindbit.

While the creation/restoration of the wallet itself doesn't need network, we need a call to get the actual birthday of the wallet from the timestamp, and also to check generated dana address availability (and register on the name server).

The idea here is to stop at this step in case we can't do one or both of those operations and fallback to a minimal mode that displays payment code. This way user can still receive a payment right away either from another wallet that is able to scan the qr code, or by sharing it over another channel in case device does have network but external services are down.

[EDIT] Some ideas of further improvements:

  • Poor network is the cause of slow startup of the app (stuck on splash screen), I haven't tackling it so far but it's certainly possible to help that part too
  • We should let user modify the external services in case default servers are taken down

@Sosthene00 Sosthene00 force-pushed the offline_mode branch 2 times, most recently from b5c4efe to 2222106 Compare February 11, 2026 22:16
@Sosthene00 Sosthene00 force-pushed the offline_mode branch 3 times, most recently from bf061e7 to caaeb70 Compare February 27, 2026 14:56
Hardcode a default `DateTime` for all network, 1st June of 2025 for now.
* `getBlockForHash`: needed to retrieve the timestamp of a block
* `getBlockHashForHeight`: retrieve the block hash from its height
* `getBlockFromTimestamp`: used to get the height of the closest block from a timestamp
Add `toSeconds()` method to `DateTime` and a `toDate()` method to `int`
Birthday becomes a DateTime (stored as unix timestamp) instead of a block height integer. Includes migration logic for existing wallets that still have a block height stored.
* add a ticker box on Seed Phrase Recovery screen
* if ticked open birthday picker
* if user does'nt provice a birthday set network default
- Set blindbitUrl even on connection failure
- Set tip to null when connection fails to properly reflect unavailable state
- `reconnect()` check availability before attempting reconnection
- Use finally block to ensure notifyListeners is always called
…checks

Stop swallowing exceptions in Bip353Resolver.isBip353AddressPresent and
DanaAddressService.isDanaUsernameAvailable, letting callers decide how to
handle network errors.

In RegisterDanaAddressScreen:
- Classify registration errors (user error vs network/server error)
- Show distinct UI for unverifiable availability (warning icon, orange color)
- Add mounted guard in registration catch block
@cygnet3
Copy link
Owner

cygnet3 commented Mar 1, 2026

Is this PR still relevant?

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.

2 participants