status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.9k stars 987 forks source link

⛓️ Feat: Wallet status badge for offline RPC handling #21401

Open friofry opened 2 weeks ago

friofry commented 2 weeks ago

Feature Issue

We have a new badge to indicate that one or more chains are out of sync. Here is the new design:

https://www.figma.com/design/xLs1KYmF4e6WwRTZVJKeUK/Wallet?node-id=17027-555628&node-type=frame&t=KHhmWfGOcIz7N0iq-0

Image

When this status-go PR is merged https://github.com/status-im/status-go/issues/5923 There would be a new event with status of chains and providers and latest success/failure timestamps.

EventBlockchainHealthChanged walletevent.EventType = "wallet-blockchain-health-changed"

Similar to the existing wallet-blockchain-status-changed (which will be deprecated and removed after this is integrated into mobile and desktop).

This event will include full RPC provider information in BlockchainFullStatus:

// BlockchainFullStatus contains the full status of the blockchain, including the status of the providers.
type BlockchainFullStatus struct {
    Status                    rpcstatus.ProviderStatus                       `json:"status"`
    StatusPerChain            map[uint64]rpcstatus.ProviderStatus            `json:"statusPerChain"`
    StatusPerChainPerProvider map[uint64]map[string]rpcstatus.ProviderStatus `json:"statusPerChainPerProvider"`
}

// ProviderStatus holds the status information for a single provider (or the aggregated status)
type ProviderStatus struct {
    Name          string     `json:"name"`
    LastSuccessAt time.Time  `json:"last_success_at"`
    LastErrorAt   time.Time  `json:"last_error_at"`
    LastError     error      `json:"last_error"`
    Status        StatusType `json:"status"`
}

User Story

As a user, I don't want to be bombarded with notifications if the RPC is down But I want to know that my balances might be out of order So I don't panic and feel that my funds were lost

Description

The Go PR by Andrey added signals that get emitted when the app goes offline. Offline can mean two things:

  1. The user went offline or
  2. The RPC is not reachable

In cases like these, the app used to panic earlier, bombarding the user with notifications. But now we have a better design to handle the process.

The idea is to downlplay being offline and keep the app working as usual.

Acceptance Criteria

Notes

xAlisher commented 2 weeks ago

Please keep in mind that the design team would like to see a 5-minute threshold as the minimum to display the tag.