From 64fa5d4cb328f4a07856d0b9cdd6595b88cfc938 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 17:23:13 +0000 Subject: [PATCH] Prioritize User Data Sync (Blocklists, DMs) over Video Feed * Boost DM decryption priority to HIGH in `nostrClient` to match other critical user data. * Enforce blocking in `handleAuthLogin` to await initial DM sync before refreshing the main video feed. * This ensures users see their personal data (blocks, messages) correctly loaded before the public feed appears, improving the perception of consistency. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- js/app.js | 13 +++++++++++++ js/nostr/client.js | 13 +++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index f0009251..296a6c11 100644 --- a/js/app.js +++ b/js/app.js @@ -3271,6 +3271,19 @@ class Application { error, ); } + + try { + await this.nostrService.loadDirectMessages({ + actorPubkey: activePubkey, + limit: 50, + initialLoad: true, + }); + } catch (error) { + devLogger.warn( + "[Application] Failed to sync direct messages during login:", + error, + ); + } } try { diff --git a/js/nostr/client.js b/js/nostr/client.js index 6ea598e0..88125a54 100644 --- a/js/nostr/client.js +++ b/js/nostr/client.js @@ -139,6 +139,7 @@ import { import { DEFAULT_NIP07_ENCRYPTION_METHODS, DEFAULT_NIP07_PERMISSION_METHODS, + NIP07_PRIORITY, clearStoredNip07Permissions, normalizePermissionMethod, readStoredNip07Permissions, @@ -4514,7 +4515,11 @@ export class NostrClient { ) { addCandidate( "nip44", - activeSigner.nip44Decrypt.bind(activeSigner), + (pubkey, ciphertext, options) => + activeSigner.nip44Decrypt(pubkey, ciphertext, { + ...options, + priority: NIP07_PRIORITY.HIGH, + }), { priority: -20, source: activeSigner.type || "signer", @@ -4528,7 +4533,11 @@ export class NostrClient { ) { addCandidate( "nip04", - activeSigner.nip04Decrypt.bind(activeSigner), + (pubkey, ciphertext, options) => + activeSigner.nip04Decrypt(pubkey, ciphertext, { + ...options, + priority: NIP07_PRIORITY.HIGH, + }), { priority: -10, source: activeSigner.type || "signer",