Skip to content

Drop invalid sync packets instead of asserting - #502

Merged
BartolomeyKant merged 1 commit into
mainfrom
drop-invalid-sync-packets
Jul 6, 2026
Merged

Drop invalid sync packets instead of asserting#502
BartolomeyKant merged 1 commit into
mainfrom
drop-invalid-sync-packets

Conversation

@NikolayChirkov

Copy link
Copy Markdown
Collaborator

Summary

  • Drop invalid sync packets instead of asserting on sync decrypt failures.
  • Cancel API parsing and drop the packet when an unknown API message id is received.
  • Skip parsing empty decrypted sub-API payloads.
  • Log dropped invalid/stale packets through AE_TELED_WARNING.

Context

This prevents crashes on stale/corrupt packets observed after client restart/close sequences, where old packets can arrive with a different crypto/session state.

Validation

Manually validated through the Support Chat restart/close scenario:

  1. Admin + Client online delivery in both directions.
  2. Close Client while Admin stays open.
  3. Close both, then open Client first and Admin second.
  4. No assert crash on decrypt/API parse failure.
  5. Messages continue to deliver in both directions.

…ailures.

Return empty decrypt results, cancel API parsing for unknown message ids, and log drops via AE_TELED_WARNING.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread aether/crypto/sodium/sodium_sync_crypto_provider.cpp
@BartolomeyKant
BartolomeyKant merged commit 7da5a86 into main Jul 6, 2026
14 checks passed
@BartolomeyKant
BartolomeyKant deleted the drop-invalid-sync-packets branch July 6, 2026 04:35
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.

2 participants