Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,12 @@ pub struct Client {
/// Matches WhatsApp Web's MAX_RETRY = 5 behavior.
pub(crate) message_retry_counts: Cache<String, u8>,

/// Most recent `RetryReason` we attached to a retry receipt for this
/// message (same key shape as `message_retry_counts`). Lets diagnostics
/// and regression tests distinguish which decrypt-failure arm actually
/// ran (the count alone can't separate NoSession from BadMac etc.).
pub(crate) recent_retry_reasons: Cache<String, wacore::protocol::retry::RetryReason>,

/// Dispatch-once gate for `UndecryptableMessage`: a server resend of a
/// failed id re-enters the failure path and would otherwise fire a
/// duplicate event. Mirrors WA Web's DB-level placeholder uniqueness
Expand Down Expand Up @@ -813,6 +819,8 @@ impl Client {

message_retry_counts: cache_config.message_retry_counts.build_with_ttl(),

recent_retry_reasons: cache_config.message_retry_counts.build_with_ttl(),

undecryptable_dispatched: cache_config.undecryptable_dispatched.build_with_ttl(),

offline_sync_metrics: Arc::new(OfflineSyncMetrics {
Expand Down
Loading
Loading