Skip to content

fix: LTSM aborts caused encryption notices and a failed image send - #233

Merged
highesttt merged 1 commit into
mainfrom
highest/plat-38468
Aug 17, 2026
Merged

fix: LTSM aborts caused encryption notices and a failed image send#233
highesttt merged 1 commit into
mainfrom
highest/plat-38468

Conversation

@highesttt

Copy link
Copy Markdown
Collaborator

No description provided.

@linear-code

linear-code Bot commented Aug 17, 2026

Copy link
Copy Markdown

PLAT-38468

@indent

indent Bot commented Aug 17, 2026

Copy link
Copy Markdown
PR Summary

Handles fatal LTSM (WASM) aborts as a recognizable error so they stop triggering spurious encryption/"re-login" notices and a failed image send, and hardens the media decrypt and request-signing paths along the way.

  • Adds ltsm.ErrAbort sentinel (_abort panics with it); isFatalLTSMError in the E2EE manager skips the V1 fallback on a V2 abort, and the inbound/outbound message paths short-circuit key refetch, retry, markMissingE2EEKey, and plaintext fallback when an abort is detected.
  • Consolidates the per-type audio/file/image/video decrypt logic into one decryptDownloadedMedia helper: tries the body keyMaterial then ENC_KM, passes genuinely-plain media through, and fails closed with ErrIgnoringRemoteEvent (retryable, no error notice) consistent with the existing mediaDownloadFailure pattern.
  • Reworks request signing to derive and cache an HMAC per access token in a 4-entry LRU, adds WASM destructor support (Destroy/SecureKeyDestroy/HmacDestroy), and frees evicted objects plus the transient objects in Sign/DebugExportDerivedSigningKey to fix WASM memory leaks.
  • Adds unit/integration tests for abort classification, media decrypt behavior, HMAC reuse/eviction, and destructor dispatch.

Issues

Review closed.

CI Checks

All CI checks passed on 2a712df.

@highesttt
highesttt merged commit 1bff055 into main Aug 17, 2026
8 checks passed
@highesttt
highesttt deleted the highest/plat-38468 branch August 17, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant