Session lifecycle and error handling
Session lifecycle and error handling
Initialize providers and shared relay connections once per application session. Fetch public profiles without requesting a signature. Keep signing, decryption and payments behind explicit user actions; show pending, declined and failed states separately.
Integration notes
On account change or logout, stop inbox subscriptions, clear decrypted views and discard late results from the old account. Treat relay completion and relay acceptance separately. Keep successful per-relay results when another relay fails. Test missing extension, user cancellation, locked vault, remote signer offline, relay rejection and uncertain payment outcomes.