feat(datachannel): add update subchannel subscriptions function#4749
feat(datachannel): add update subchannel subscriptions function#4749Tianhui-Han wants to merge 3 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 👍 / 👎.
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.