Skip to content

test(controller): add failing repro for setZoom-before-start race#3908

Open
Jakef14 wants to merge 1 commit into
mrousavy:mainfrom
Jakef14:fix/zoom-updater-camerax-race
Open

test(controller): add failing repro for setZoom-before-start race#3908
Jakef14 wants to merge 1 commit into
mrousavy:mainfrom
Jakef14:fix/zoom-updater-camerax-race

Conversation

@Jakef14
Copy link
Copy Markdown

@Jakef14 Jakef14 commented May 21, 2026

useZoomUpdater (src/hooks/internal/useZoomUpdater.ts:16) fires controller.setZoom synchronously on the component's first mount, before the consumer's isActive toggle has caused the session to start. The returned promise is discarded, so on Android the CameraX OperationCanceledException: Camera is not active rejection surfaces as an Unhandled Promise Rejection that consumers cannot intercept. only receives CameraRuntimeError instances.

This adds a failing harness test that reproduces the timing imperatively: configure() the session, then call setZoom before start() — the moment useZoomUpdater hits today.

`useZoomUpdater` (src/hooks/internal/useZoomUpdater.ts:16) fires
controller.setZoom synchronously on the <Camera> component's first
mount, before the consumer's `isActive` toggle has caused the session
to start. The returned promise is discarded, so on Android the CameraX
`OperationCanceledException: Camera is not active` rejection surfaces
as an Unhandled Promise Rejection that consumers cannot intercept.
<Camera onError> only receives CameraRuntimeError instances.

This adds a failing harness test that reproduces the timing
imperatively: configure() the session, then call setZoom before
start() — the moment useZoomUpdater hits today.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

@JakeF14-SN is attempting to deploy a commit to the Margelo Team on Vercel.

A member of the Team first needs to authorize it.

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