Skip to content

Restore camera executor after Android view reattachment - #817

Open
zack-dev-cm wants to merge 1 commit into
teslamotors:masterfrom
zack-dev-cm:fix/camera-executor-reattachment
Open

zack-dev-cm wants to merge 1 commit into
teslamotors:masterfrom
zack-dev-cm:fix/camera-executor-reattachment

Conversation

@zack-dev-cm

@zack-dev-cm zack-dev-cm commented Sep 15, 2026 •

Copy link
Copy Markdown

Summary

Detaching a CKCamera shuts down its camera executor. Reattaching the same view reuses that executor, so submitting analysis work throws RejectedExecutionException.

Create a new single-thread executor during attachment only when the previous executor is shut down. Already-submitted work can finish on the old executor while the new attachment accepts work independently.

This fixes the separate reattachment defect noted in #813 and starts independently from upstream. Scanner ownership remains in #813, coordinate mapping in #812, and CI toolchain drift in #816.

How did you test this change?

Independent head 39eee8e, against unchanged a2a81ce:

  • The original compiled CKCamera fails two Robolectric regressions with RejectedExecutionException; the active-executor control passes.
  • All three tests pass with the correction in both React Native architectures, without skips. They cover three reuse cycles, retaining an active executor, and reattachment while an old task is still finishing.
  • The Android Debug AAR builds with the new architecture enabled; git diff --check passes.

The four-PR merge guide identifies the overlapping files and the exact resolution at 7ffe27b. Its public validation passes 41 Robolectric tests with zero skips, including these three regressions, plus TypeScript, ESLint and installed Debug AAR builds in both architectures.

The tests invoke real view callbacks and executor threads with camera permission denied. Physical-camera recovery remains unverified. iOS source is unchanged; upstream Build and Linter workflows await approval.

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