Repository navigation
fix(server-sdk): leave SIP dial options unmodified - #770
Open
Abhishek-B-R wants to merge 1 commit into
Open
Abhishek-B-R wants to merge 1 commit into
Abhishek-B-R wants to merge 1 commit into
Conversation
createSipParticipant (with waitUntilAnswered) and transferSipParticipant filled in the default ringing window and the derived request timeout by assigning to the options object the caller passed, so the caller saw ringingTimeout and timeout appear on their object after the call, and a frozen options object threw "Cannot add property ... object is not extensible". Compute both values in locals instead, as acceptWhatsAppCall already does.
🦋 Changeset detectedLatest commit: 742b5bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this 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.
Description
createSipParticipant(withwaitUntilAnswered) andtransferSipParticipantfill in the default ring window and the derived request timeout by assigning to the options object the caller passed in:Two visible effects:
ringingTimeout: 30andtimeout: 32on it, which they never set. If that object is shared or reused (for example passed to a latercreateSipParticipantwithoutwaitUntilAnswered), those values go out with the next request too.This change computes both values in locals and passes those to the request, the same way
acceptWhatsAppCallinConnectorClientalready handles its timeout. The request body and the request timeout are unchanged: stillringingTimeout: "30s"and a 32 second timeout by default, andringingTimeout + 2when one is given.Testing
Added
src/SipClient.test.ts, which stubsfetchandAbortSignal.timeoutand checks, for both methods, that the options object is untouched, that frozen options work, and that the request still carries the expectedringingTimeoutand timeout.expected { ..., ringingTimeout: 30, timeout: 32 }, twoTypeError: Cannot add property ..., object is not extensible).Also ran in
packages/livekit-server-sdk:pnpm test,pnpm test:browser,pnpm test:edge(47 passed each, the API tests skip without the mock server),pnpm lint(no new warnings),prettier --checkon the changed files, andpnpm build.A patch changeset for
livekit-server-sdkis included.