diff --git a/src/services/db.ts b/src/services/db.ts index 5e7c7ea..6333836 100644 --- a/src/services/db.ts +++ b/src/services/db.ts @@ -453,10 +453,22 @@ export const relayLivenessStorage = { export const encryptedContentStorage = { async getItem(id: string): Promise { const entry = await db.encryptedContent.get(id); - return entry?.plaintext ?? null; + const plaintext = entry?.plaintext ?? null; + + if (plaintext) { + console.log( + `[EncryptedContentStorage] getItem(${id.slice(0, 8)}): ${plaintext.slice(0, 100)}...`, + ); + } + + return plaintext; }, async setItem(id: string, plaintext: string): Promise { + console.log( + `[EncryptedContentStorage] setItem(${id.slice(0, 8)}): ${plaintext.slice(0, 100)}...`, + ); + await db.encryptedContent.put({ id, plaintext, diff --git a/src/services/gift-wrap.ts b/src/services/gift-wrap.ts index 61b8a02..65777e5 100644 --- a/src/services/gift-wrap.ts +++ b/src/services/gift-wrap.ts @@ -799,12 +799,18 @@ class GiftWrapService { // Update decrypt states for new gift wraps let newUnlocked = 0; let newPending = 0; + let hasSymbolCount = 0; + let hasPersistedCount = 0; + for (const gw of giftWraps) { if (!this.decryptStates.has(gw.id)) { const hasSymbol = isGiftWrapUnlocked(gw); const hasPersisted = this.persistedIds.has(gw.id); const isUnlocked = hasSymbol || hasPersisted; + if (hasSymbol) hasSymbolCount++; + if (hasPersisted) hasPersistedCount++; + if (isUnlocked) { newUnlocked++; } else { @@ -840,7 +846,7 @@ class GiftWrapService { dmInfo( "GiftWrap", - `Decrypt states: ${newUnlocked} unlocked, ${newPending} pending (total: ${this.decryptStates.size})`, + `Decrypt states: ${newUnlocked} unlocked (${hasSymbolCount} symbols, ${hasPersistedCount} cached), ${newPending} pending (total: ${this.decryptStates.size})`, ); this.decryptStates$.next(new Map(this.decryptStates));