@@ -17,8 +17,31 @@ Future<RelayType> relayTypeInbox() => RustLib.instance.api.crateApiRelaysRelayTy
1717
1818Future <RelayType > relayTypeKeyPackage () => RustLib .instance.api.crateApiRelaysRelayTypeKeyPackage ();
1919
20- Future <List <(String , String )>> fetchRelayStatus ({required String pubkey}) =>
21- RustLib .instance.api.crateApiRelaysFetchRelayStatus (pubkey: pubkey);
20+ Future <List <(String , String )>> getAccountRelayStatuses ({
21+ required String pubkey,
22+ }) => RustLib .instance.api.crateApiRelaysGetAccountRelayStatuses (pubkey: pubkey);
23+
24+ /// Ensures all subscriptions (global and all accounts) are operational.
25+ ///
26+ /// This method is designed for periodic background tasks that need to ensure
27+ /// the entire subscription system is functioning. It checks and refreshes
28+ /// global subscriptions first, then iterates through all accounts.
29+ ///
30+ /// Uses a best-effort strategy: if one subscription check fails, logs the error
31+ /// and continues with the remaining checks. This maximizes the number of working
32+ /// subscriptions even when some fail due to transient network issues.
33+ ///
34+ /// # Error Handling
35+ ///
36+ /// - **Subscription errors**: Logged and ignored, processing continues
37+ /// - **Database errors**: Propagated immediately (catastrophic failure)
38+ ///
39+ /// # Returns
40+ ///
41+ /// - `Ok(())` : Completed all checks (some may have failed, check logs)
42+ /// - `Err(_)` : Only on catastrophic failures (e.g., database connection lost)
43+ Future <void > ensureAllSubscriptions () =>
44+ RustLib .instance.api.crateApiRelaysEnsureAllSubscriptions ();
2245
2346class Relay {
2447 final String url;
0 commit comments