Skip to content

fix(e2ee): heal orphaned encrypted sidebar previews on deferred decrypt#965

Merged
mremond merged 1 commit into
mainfrom
mr/openpgp-sidebar-preview-583c14
Jul 10, 2026
Merged

fix(e2ee): heal orphaned encrypted sidebar previews on deferred decrypt#965
mremond merged 1 commit into
mainfrom
mr/openpgp-sidebar-preview-583c14

Conversation

@mremond

@mremond mremond commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

An OpenPGP sidebar preview could stay stuck on [OpenPGP-encrypted message] until the conversation was opened.

The preview (conversationMeta.lastMessage) can carry an encryptedPayload + fallback body that persists across launches, but every deferred-decrypt heal path keys off the message stores (in-memory conversation arrays, IndexedDB messages) — none re-decrypt a preview from the ciphertext stashed in the preview itself. So when the preview's message is absent or already decrypted in those stores (evicted, healed-in-IndexedDB, or set preview-only by a MAM preview refresh), only opening the conversation heals it.

Adds a symmetric preview-level heal to retryPending(): enumerate previews still carrying encryptedPayload (new getEncryptedPreviews binding) and re-decrypt straight from the stash, applying refreshLastMessageContent. Dedups against handledChatKeys so a preview a store pass already repaired is not re-processed. Runs on every launch via the plugin-registered retry, so no explicit key-unlock is required.

The sidebar preview (conversationMeta.lastMessage) can carry an
encryptedPayload + "[OpenPGP-encrypted message]" fallback that persists
across launches, but every deferred-decrypt heal path keys off the message
stores (in-memory conversation arrays, IndexedDB messages) — none re-decrypt
a preview from the ciphertext stashed in the preview itself. When the
preview's message is absent or already decrypted in those stores (evicted,
healed-in-IndexedDB, or set preview-only by a MAM preview refresh), the
preview stays stuck on the fallback until the conversation is opened.

Add a symmetric preview-level heal to retryPending(): enumerate previews
still carrying encryptedPayload (new getEncryptedPreviews binding) and
re-decrypt straight from the stash, applying refreshLastMessageContent.
Dedup against handledChatKeys so a preview a store pass already repaired is
not re-processed.
@mremond mremond added this to the 0.17.1 milestone Jul 10, 2026
@mremond mremond merged commit 45e8562 into main Jul 10, 2026
3 checks passed
@mremond mremond deleted the mr/openpgp-sidebar-preview-583c14 branch July 10, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant