Remove TurnServer workarounds, add error-path tests#1530
Open
CraziestPower wants to merge 2 commits intosipsorcery-org:masterfrom
Open
Remove TurnServer workarounds, add error-path tests#1530CraziestPower wants to merge 2 commits intosipsorcery-org:masterfrom
CraziestPower wants to merge 2 commits intosipsorcery-org:masterfrom
Conversation
Replace BuildErrorCodeAttribute() and VerifyMessageIntegrity() workarounds with the now-fixed library methods: STUNErrorCodeAttribute(code, reason) and request.CheckIntegrity(key). Add 5 tests covering the previously untested error-code paths (437 duplicate allocation, 437 refresh/createpermission/ channelbind without allocation, 400 malformed channelbind) plus an AssertErrorCode helper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6a0884a to
0360df1
Compare
…rAgent The CloseWhileReceivingDoesNotThrowUnobservedException test was intermittently failing on macOS CI because it caught an unobserved NullReferenceException originating from SIPUserAgent.AcceptAttendedTransfer, not from UdpReceiver code. This happened because AcceptAttendedTransfer accesses MediaSession and m_sipDialogue after an await, but by that time the agent may have been disposed (setting both to null). Two fixes applied: - Root cause: add null guards in AcceptAttendedTransfer after the hold delay, capturing local references before the null check to avoid TOCTOU races. If the call was terminated during hold processing, the transfer is cleanly aborted. - Defense in depth: filter the UnobservedTaskException handler in the UdpReceiver test to only capture exceptions whose stack trace mentions UdpReceiver, ignoring unrelated leaked exceptions from other tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
|
Thanks for the PR. The title does say it relates to TURN but there are changes to the SIPUserAgent that I suspect should be in a different PR. |
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.
Summary
BuildErrorCodeAttribute()workaround withnew STUNErrorCodeAttribute(code, reason)at all 8 call sites (fix landed in Fix STUNErrorCodeAttribute(int, string) constructor #1509)VerifyMessageIntegrity()workaround withrequest.CheckIntegrity(key)(fix landed in Fix CheckIntegrity() failing when FINGERPRINT is absent #1510)rawBytesparameter fromProcessMessage/HandleAllocateAssertErrorCodetest helperTest plan
dotnet build src/SIPSorcery.slncompiles cleanlydotnet test test/unit/SIPSorcery.UnitTests.csproj -f net8.0 --filter TurnServer— all 17 tests pass (12 existing + 5 new)Closes #1529
🤖 Generated with Claude Code