Skip to content

feat(meetings): e2ee wasm module loading - #5344

Merged
marcin-bazyl merged 4 commits into
webex:nextfrom
marcin-bazyl:e2ee-pr-wasm-loading
Nov 6, 2026
Merged

marcin-bazyl merged 4 commits into
webex:nextfrom
marcin-bazyl:e2ee-pr-wasm-loading

Conversation

@marcin-bazyl

@marcin-bazyl marcin-bazyl commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

COMPLETES #SPARK-871963

This pull request addresses

Full set of remaining changes for E2EE MLS support in JS_SDK is here: #5305 but they are being split into a set of small PRs. This PR is one of them.

Here we have only the part for loading the WASM module.

by making the following changes

  • Preloads the E2EE WASM module after meetings registration when E2EE is enabled and WebAssembly is supported. A preload failure does not block registration.
  • Loads the Emscripten JavaScript loader with a native dynamic import so it stays outside the SDK bundle.
  • Adds Babel configuration to preserve that import and updates WASM loader URL handling, caching, and retry behavior.

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

unit tests

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.

@marcin-bazyl
marcin-bazyl requested review from a team as code owners November 4, 2026 09:25
@aws-amplify-us-east-2

Copy link
Copy Markdown

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

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

@marcin-bazyl marcin-bazyl added the validated If the pull request is validated for automation. label Nov 4, 2026

@chrisadubois chrisadubois left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nothing blocking but please do read through the comments.

Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_SUCCESS);

// Preload is best-effort and must not delay or fail Meetings registration.
this.e2eeManager?.preload().catch((error) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we have retries we want to manage for this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it's using webex.request() that already does retries automatically and additionally if preload fails, we attempt the load again 2nd time when you do an e2ee meeting join


// Construct after READY because the manager uses the initialized webex client and config.
// @ts-ignore
this.e2eeManager = new E2eeManager({webex: this.webex, wasmLoader: this.wasmLoader});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: structurally, do we want to have the wasm loader on the meetings/index, or should it be entirely maintained inside of the places where it's needed? I guess it's a shared cache so I get why we'd have it out, and it doesn't really matter since it's not exposed...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yeah I was also debating this with myself, AI did it this way and I thought it's probably fine, we may want to load other wasm modules for other things in the future

wasmLoader.preload.rejects(error);
const manager = new E2eeManager({webex: makeWebex(true), wasmLoader});

await assert.isRejected(manager.preload(), /asset load failed/);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we add something to show registration completed after this? (separate test)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this is already covered in meetings test: "does not fail registration when E2EE preloading rejects"

* multiple distinct modules; each URL is loaded at most once and cached. Instantiated once per
* session so slow loads can be warmed ahead of when they're needed.
*/
export default class WasmLoader {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IMO this really does not belong inside of meetings. honestly it barely belongs in the main webex packages

@marcin-bazyl marcin-bazyl Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, agreed, I'll move it to webex-core, so it's there together with StaticAssetLoader, but I'll do it in a separate PR

import LoggerProxy from '../common/logs/logger-proxy';
import WasmLoader from '../common/wasm-loader';

const E2EE_WASM_ASSET = 'e2ee-0.0.1.wasm';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

???? can we get a comment for this constant. I know we had some specific versioning and we have to update for this to work, this definitely needs a comment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added a comment.

@github-actions github-actions Bot removed the validated If the pull request is validated for automation. label Nov 6, 2026
@marcin-bazyl marcin-bazyl added the validated If the pull request is validated for automation. label Nov 6, 2026
@marcin-bazyl
marcin-bazyl merged commit 37a83ce into webex:next Nov 6, 2026
11 of 12 checks passed
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
🎉 Your changes are now available!
Released in: v3.13.0-next.7
📖 View full changelog →
Packages Updated Version
webex 3.13.0-next.7
@webex/plugin-meetings 3.13.0-next.6

Thank you for your contribution!
🤖 This is an automated message. For queries, please contact support.

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

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants