feat(datachannel): add update subchannel subscriptions function#4749
feat(datachannel): add update subchannel subscriptions function#4749Tianhui-Han wants to merge 9 commits intowebex:nextfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3c22b4ce0
ℹ️ 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".
| public updateSubchannelSubscriptions = ({ | ||
| subscribe = [], | ||
| unsubscribe = [], | ||
| }: { |
There was a problem hiding this comment.
Handle undefined options in updateSubchannelSubscriptions
This destructuring requires an argument object, so calling updateSubchannelSubscriptions() from JavaScript (or any untyped call path) throws a runtime TypeError before the isConnected() guard runs. Because the method already provides defaults for subscribe/unsubscribe, callers reasonably expect the no-arg form to behave like an empty update rather than crash; adding a default for the whole parameter (e.g., {}) avoids this production failure mode.
Useful? React with 👍 / 👎.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d04435fcf4
ℹ️ 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 connectUrl = this.isDataChannelTokenEnabled() | ||
| ? LLMChannel.buildUrlWithAwareSubchannels(this.webSocketUrl, AWARE_DATA_CHANNEL) |
There was a problem hiding this comment.
Await token feature gate before selecting connect URL
isDataChannelTokenEnabled() returns a Promise<boolean>, but it is used directly in a ternary, so the condition is always truthy and buildUrlWithAwareSubchannels() runs even when the developer feature flag resolves to false. In environments where the flag is disabled, clients will still connect with subscriptionAwareSubchannels appended, which defeats the intended rollout gate and can change server behavior for all connections on this path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84acaf49a0
ℹ️ 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".
| sessionData.datachannelToken = datachannelToken; | ||
| this.connections.set(sessionId, sessionData); | ||
|
|
||
| const connectUrl = isDataChannelTokenEnabled |
There was a problem hiding this comment.
Resolve feature gate before URL selection
In registerAndConnect, the ternary reads isDataChannelTokenEnabled even though that identifier is not defined in this scope, so calling this method with valid locusUrl/datachannelUrl will throw a runtime ReferenceError before connect() runs. Because no-undef is disabled for TypeScript in this repo, this can slip through linting and break all LLM connection attempts on this path.
Useful? React with 👍 / 👎.
| const connectUrl = isDataChannelTokenEnabled | ||
| ? LLMChannel.buildUrlWithAwareSubchannels(this.webSocketUrl, AWARE_DATA_CHANNEL) | ||
| : this.webSocketUrl; |
There was a problem hiding this comment.
Pass subscription-aware URL into connect
This block computes connectUrl with subscriptionAwareSubchannels, but the method still calls connect(sessionData.webSocketUrl, sessionId), so the new query parameter is never actually used. In environments expecting this flag-controlled URL decoration, clients will continue connecting with the unmodified WebSocket URL and the new feature will not take effect.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ac617cb11
ℹ️ 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".
| @@ -0,0 +1,16 @@ | |||
| import * as jose from 'jose'; | |||
There was a problem hiding this comment.
Declare jose in plugin-meetings runtime dependencies
isJwtTokenExpired now imports jose, but @webex/plugin-meetings does not declare jose in its dependencies (it only appears in packages/byods/package.json), so published consumers that install meetings without byods can hit Cannot find module 'jose' as soon as this interceptor module is loaded. Please add jose to packages/@webex/plugin-meetings/package.json so this new runtime import is always resolvable.
Useful? React with 👍 / 👎.
| return this.connect(sessionData.webSocketUrl, sessionId); | ||
| const isDataChannelTokenEnabled = await this.isDataChannelTokenEnabled(); | ||
|
|
||
| const connectUrl = isDataChannelTokenEnabled |
There was a problem hiding this comment.
Should be isDataChannelTokenEnabled && datachannelToken, not noly the toggle is on but also the token is used when registration
| * @param {string[]} options.unsubscribe Sub‑channels to unsubscribe from. | ||
| * @returns {void} | ||
| */ | ||
| public updateSubchannelSubscriptions = ({ |
There was a problem hiding this comment.
When the function is called?
Add update subchannel subscriptions function
IMPORTANT
FAILING TO FILL OUT THIS TEMPLATE WILL RESULT IN REJECTION OF YOUR PULL REQUEST
This is for compliance purposes with FedRAMP program.
-->
COMPLETES #< INSERT LINK TO ISSUE >
This pull request addresses
https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-763776
by making the following 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.