Repository navigation
fix(transaction): retain exact ACKs for each answered fork - #247
Merged
Merged
Conversation
yeoleobun
force-pushed
the
codex/fix-fork-ack-cache
branch
from
November 12, 2026 07:14
569ec20 to
f42ce14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes ACK handling when an INVITE receives successful responses from multiple forks.
Previously, only the latest ACK was retained. With responses A → B → retransmitted A, the stack could regenerate A’s ACK with a different Via branch and lose an application-provided SDP answer. After transaction cleanup, it could also replay another fork’s ACK to the wrong destination.
Cache successful ACKs by structured dialog identity and INVITE CSeq, preserving the exact request and resolved destination. Transfer these entries to the finished-transaction cache and expire them through the existing cleanup timer. Retransmissions do not restart Timer M.
Known forks receive their own cached ACK after the transaction owner is dropped. Unknown forks are not acknowledged using another fork’s request; applications must keep driving the Accepted transaction to handle new forks. Proxy responses with an upstream Via remain excluded from automatic ACK replay.
Two public-API UDP regressions cover alternating fork responses, exact ACK replay including SDP, destination selection, replay after drop, unknown forks, and cache expiry. Both reproduce failures before the fix.
Validation:
cargo test: 636 library tests, 2 public-API regressions, 7 harness tests, and 68 doctests passed.cargo check --all-targetscargo check --lib --no-default-features --features platform-embassycargo fmt --all --check