Skip to content

camera-effects: lock engine access when it is recreated#847

Draft
nandito wants to merge 2 commits intomainfrom
nandor/cob-2338-typeerror-null-is-not-an-object-evaluating
Draft

camera-effects: lock engine access when it is recreated#847
nandito wants to merge 2 commits intomainfrom
nandor/cob-2338-typeerror-null-is-not-an-object-evaluating

Conversation

@nandito
Copy link
Contributor

@nandito nandito commented Jan 16, 2026

Description

Summary:

Add an _engineLock to Processor, and use it to prevent unintended engine.dispose() race condition between updateParams and updateVideoSize.

Related Issue:

Testing

  1. Open camera effects settings panel in Safari with devtools open
  2. Set / unset camera effects
  3. Upload a custom bg, use it, then unset and remove it
  4. Set a camera effect, then change the constraints of raw media streams (not the effect track) to different values to trigger the updateVideoSize mediaStream.getVideoTracks()[0].applyConstraints({height: { exact: 360 }}) and try to quickly change the effects.

There should be no Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'this.engine.updateBackgroundFrame') error in the console.

Screenshots/GIFs (if applicable)

Checklist

  • My code follows the project's coding standards.
  • Prefixed the PR title and commit messages with the service or package name
  • I have written unit tests (if applicable).
  • I have updated the documentation (if applicable).
  • By submitting this pull request, I confirm that my contribution is made
    under the terms of the MIT license.

Additional Information

Add an `_engineLock` to Processor, and use it to prevent unintended
`engine.dispose()` race condition between `updateParams` and
`updateVideoSize`.
@changeset-bot
Copy link

changeset-bot bot commented Jan 16, 2026

🦋 Changeset detected

Latest commit: 53f8a0f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@whereby.com/camera-effects Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nandito
Copy link
Contributor Author

nandito commented Jan 19, 2026

/canary

@github-actions
Copy link
Contributor

🚀 The canary release has been published to npm.

You can test the release by installing the newly published version:

pnpm add @whereby.com/camera-effects@0.0.0-canary-20260119084133

@nandito
Copy link
Contributor Author

nandito commented Jan 30, 2026

/canary

@github-actions
Copy link
Contributor

🚀 The canary release has been published to npm.

You can test the release by installing the newly published version:

pnpm add @whereby.com/camera-effects@0.0.0-canary-20260130110354

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.

1 participant