Speed up Nostr login and fix list sync, signer persistence, and feed registration

The NIP-07 login flow was extremely slow because list decryption (blocks,
subscriptions, hashtag preferences) started before the signer was ready.
On page refresh, all three services failed with "permission-required" and
scheduled 3-second retry delays, adding 6-10 seconds to every login.

Key fixes:
- List loading now waits for the permission pre-grant to complete before
  attempting decryption, ensuring the signer is available on first try
- Extension wait timeout increased from 3s to 5s for slower extensions
- Decrypt timeouts reduced from 20s to 10s (signer is guaranteed ready)
- Auto-login now forwards authType/providerId from saved profiles
- Storage tab unlock falls back to ensureActiveSignerForPubkey when the
  global signer is not yet registered
- Watch history feed registration adds defensive re-registration and
  try/catch fallback to prevent "Feed not registered" errors
- Decryption scheme cache TTL extended from 10 minutes to 2 hours
- ensureExtensionPermissions waits for extension injection when there
  are outstanding permissions to request (was returning immediately)

https://claude.ai/code/session_01T4wwPu7m5qp1Nxx3H2v57j
This commit is contained in:
Claude committed 2026-02-08 02:02:51 +00:00
1 parent ce16140343
commit 8bf8da03b9
10 files changed
+101 -29

No files matched your search

+14 -4
View File
@@ -9956,10 +9956,20 @@ export class ProfileModalController {
const pubkey = this.normalizeHexPubkey(this.getActivePubkey());
if (!pubkey) return;
// We need the active signer.
const signer = getActiveSigner();
// Or try resolving via client if global one is missing?
// ProfileModalController imports getActiveSigner.
// We need the active signer. Try the global first, then resolve via the
// nostr client which can detect/restore the NIP-07 extension signer.
let signer = getActiveSigner();
if (
!signer &&
this.services.nostrClient &&
typeof this.services.nostrClient.ensureActiveSignerForPubkey === "function"
) {
try {
signer = await this.services.nostrClient.ensureActiveSignerForPubkey(pubkey);
} catch (error) {
devLogger.warn("[ProfileModal] Failed to resolve signer for storage unlock:", error);
}
}
if (!signer) {
this.showError("No active signer found. Please login.");