From 5ae693acbda5411f1c6ab8c75ad8ae45fdf149d2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:20:34 +0000 Subject: [PATCH] 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 <53631862+PR0M3TH3AN@users.noreply.github.com> --- js/app.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/js/app.js b/js/app.js index 1b3ce27b..f0009251 100644 --- a/js/app.js +++ b/js/app.js @@ -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 {