Repository navigation
stopped session stays unbound after another session is cleared (Android repro) - #4231
Open
dakshshah96 wants to merge 1 commit into
Open
dakshshah96 wants to merge 1 commit into
dakshshah96 wants to merge 1 commit into
Conversation
On Android, HybridCameraSession.configure() and dispose() call ProcessCameraProvider.unbindAll(). The provider is process-wide, so clearing one session also unbinds every other session's use-cases, and a stopped session that is started again never reopens the camera. This test stops session A, sets up and clears session B on the same camera, then restarts A and captures a photo from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@dakshshah96 is attempting to deploy a commit to the Margelo Team on Vercel. A member of the Team first needs to authorize it. |
9 of 18 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What the test does
configure([]). This is what a second<Camera>mounting and unmounting does viauseCameraSession's cleanup.onStartedand capture a photo.Expected: A restarts and captures. On Android it shouldn't, because A's use-cases were unbound by B.
Cause
HybridCameraSession.configure()anddispose()(Android) callcameraProvider.unbindAll().ProcessCameraProvideris process-wide, so tearing down one session unbinds every other session too. A'sstart()then only moves itsCustomLifecycletoRESUMEDwith nothing bound. In our app this shows up as a black preview and a dead torch on a tab screen's<Camera>(kept mounted withisActive={false}) after another screen's<Camera>unmounts.Fix we're running locally
Each session remembers the
SessionConfigit bound (or the use-cases, for multi-cam) and unbinds only those withcameraProvider.unbind(...), in bothconfigure()anddispose(). That fixed it on our device (Redmi Note 11T 5G, Android 11; VisionCamera 5.2.3, RN 0.88.0, New Architecture): 25/25 previews live across 12 round trips. Happy to open that as a PR if it's the direction you want.I haven't been able to run the harness suite locally, so I'm relying on CI to confirm the failure.