mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 21:02:28 +00:00
Fix list loading reliability and optimize NIP-07 login performance
- Fixes issue where user lists (subscriptions, blocks) fail to load if local cache is stale but metadata store is fresh. - Updates `js/userBlocks.js` and `js/subscriptions.js` to persist `createdAt` timestamp and use it for incremental fetch `since` parameter. - Optimizes `js/nostr/client.js` `ensureActiveSignerForPubkey` to reduce redundant `getPublicKey` calls to NIP-07 extension by 50%. - Adds `preloadedPubkey` support to `createNip07Adapter`. - Adds reproduction test for NIP-07 concurrency issue. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
792473f56f
commit
5bdca14364
5 files changed
+132
-19
No files matched your search
+2
-2
@@ -491,7 +491,7 @@ class SubscriptionsManager {
|
||||
pubkey: normalizedUserPubkey,
|
||||
dTag: SUBSCRIPTION_LIST_IDENTIFIER,
|
||||
relayUrls,
|
||||
since: shouldForceFullFetch ? 0 : undefined,
|
||||
since: shouldForceFullFetch ? 0 : (cachedSnapshot.createdAt || 0),
|
||||
timeoutMs: 12000,
|
||||
});
|
||||
|
||||
@@ -514,7 +514,7 @@ class SubscriptionsManager {
|
||||
pubkey: normalizedSessionActorPubkey,
|
||||
dTag: SUBSCRIPTION_LIST_IDENTIFIER,
|
||||
relayUrls,
|
||||
since: shouldForceSessionFetch ? 0 : undefined,
|
||||
since: shouldForceSessionFetch ? 0 : (sessionCachedSnapshot.createdAt || 0),
|
||||
timeoutMs: 12000,
|
||||
});
|
||||
if (sessionEvents.length) {
|
||||
|
||||
Reference in new issue
Block a user