Prioritize user lists syncing during login

Prioritize fetching of block lists, subscriptions, and other user data before loading the main video feed during login.
- In `handleAuthLogin`, stop the existing video feed subscription immediately to free up bandwidth.
- Explicitly await `subscriptions.ensureLoaded(activePubkey)` alongside `userBlocks.seedWithNpubs` before triggering `refreshAllVideoGrids`.
This ensures user context is fully loaded before the heavy feed sync starts, addressing slow sync issues especially with NIP-07.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-01-28 16:20:34 +00:00
1 parent 358e077ec7
commit 5ae693acbd
1 file changed
+18
+18
View File
@@ -4097,6 +4097,15 @@ class Application {
this.resetViewLoggingState();
}
// Stop existing feed subscription to prioritize user data sync
if (
this.videoSubscription &&
typeof this.videoSubscription.unsub === "function"
) {
this.videoSubscription.unsub();
this.videoSubscription = null;
}
this.applyAuthenticatedUiState();
this.commentController?.refreshAuthState?.();
this.updateShareNostrAuthState({ reason: "auth-login" });
@@ -4279,6 +4288,15 @@ class Application {
);
}
}
try {
await subscriptions.ensureLoaded(activePubkey);
} catch (error) {
devLogger.warn(
"[Application] Failed to load subscriptions during login:",
error,
);
}
}
try {