Fix subscription feed hydration and infinite loading state

This commit is contained in:
google-labs-jules[bot] committed 2026-01-08 19:24:10 +00:00
1 parent 19cafc9f1a
commit b07332395b
3 files changed
+158 -1

No files matched your search

+13 -1
View File
@@ -420,7 +420,19 @@ class SubscriptionsManager {
this.loadingPromise = loader;
try {
await loader;
// Race against a timeout so the UI doesn't hang indefinitely if relays stall.
const timeoutMs = 6000;
await Promise.race([
loader,
new Promise((_, reject) =>
setTimeout(
() => reject(new Error("Timeout loading subscriptions")),
timeoutMs
)
),
]);
} catch (error) {
userLogger.warn("[SubscriptionsManager] ensureLoaded timed out or failed:", error);
} finally {
this.loadingPromise = null;
}