feat(calling): add calling transport layer#4811
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8e73580fd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| this.offlineHandler = () => { | ||
| handler({ | ||
| source: CallingTransportConnectionSource.MERCURY, | ||
| state: CallingTransportConnectionState.OFFLINE, | ||
| }); |
There was a problem hiding this comment.
Keep per-callback state for connection listeners
LegacyMercuryTransportAdapter stores only one offlineHandler/onlineHandler pair on the adapter instance, so each onConnectionStateChange() call overwrites the previous callbacks while leaving the previous Mercury listeners registered. In any flow with multiple registrations (for example multiple CallingClient instances or repeated init/teardown), offConnectionStateChange() can only remove the most recently stored handlers, which leaves stale listeners active and can cause duplicate or misrouted connection-state handling.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45a6721a29
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const webex = SDKConnector.getWebex(); | ||
|
|
||
| if (webex) { | ||
| CallingTransport.transportAdapter.dispose?.(webex); |
There was a problem hiding this comment.
Await adapter disposal before switching transport
setAdapter() invokes transportAdapter.dispose but does not await it, even though ICallingTransportAdapter.dispose is allowed to return Promise<void>. If a custom adapter performs async teardown (for example, closing a socket or unregistering listeners), the new adapter is installed immediately and both adapters can run concurrently, causing duplicate events or resource leaks during adapter swaps.
Useful? React with 👍 / 👎.
COMPLETES #< INSERT LINK TO ISSUE >
This pull request addresses
< DESCRIBE THE CONTEXT OF THE ISSUE >
by making the following changes
< DESCRIBE YOUR CHANGES >
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.