Skip to content

feat(datachannel): add update subchannel subscriptions function#4749

Open
Tianhui-Han wants to merge 9 commits intowebex:nextfrom
Tianhui-Han:feat/datachannel_update_sub_datachannel_subscriptions
Open

feat(datachannel): add update subchannel subscriptions function#4749
Tianhui-Han wants to merge 9 commits intowebex:nextfrom
Tianhui-Han:feat/datachannel_update_sub_datachannel_subscriptions

Conversation

@Tianhui-Han
Copy link
Contributor

@Tianhui-Han Tianhui-Han commented Mar 4, 2026

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@Tianhui-Han Tianhui-Han requested review from a team as code owners March 4, 2026 06:47
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +590 to +593
public updateSubchannelSubscriptions = ({
subscribe = [],
unsubscribe = [],
}: {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4749.d3m3l2kee0btzx.amplifyapp.com

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +120 to +121
const connectUrl = this.isDataChannelTokenEnabled()
? LLMChannel.buildUrlWithAwareSubchannels(this.webSocketUrl, AWARE_DATA_CHANNEL)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +137 to +139
const connectUrl = isDataChannelTokenEnabled
? LLMChannel.buildUrlWithAwareSubchannels(this.webSocketUrl, AWARE_DATA_CHANNEL)
: this.webSocketUrl;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the function is called?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants