Skip to content

Conversation

Copy link

Copilot AI commented Jul 2, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Thank you for your open source contributions.

Current behavior

Our users reported the scanner not showing. After looking into it we believe that when updating isActive prop with the same prop to show/hide the scanner camera a race condition seems to occur causing the session to become nil and since setupIfNeeded doesn't seem to get recalled from setting isActive the component gets "stuck" in a state unable to reopen the camera until the app is closed and reopened.

Another issue somewhat related is that the memory is not getting released on unMount automatically, forcing us to do it JS side or not do it at all.

Expected behavior

The component always closes and opens the camera.

How to reproduce?

Very hard to reproduce organically (as its sometimes is with race conditions) but in theory tapping opening and closing really fast on a high refresh rate screen may trigger it.

Preview

What have you tried so far?

Your Environment

software version
ios 18.5
android N/A (iOS only)
react-native v0.76.9
@pushpendersingh/react-native-scanner v1.5.0
node v20.19.1
npm or yarn npm

Fixes #46.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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.

Race condition on iOS setActive behavior. Non-explicit documentation

1 participant