Skip to content

fix: emit current orientation on subscribe - #4150

Merged
mrousavy merged 1 commit into
mainfrom
agent/fix-orientation-listener-initial-values
Aug 12, 2026
Merged

fix: emit current orientation on subscribe#4150
mrousavy merged 1 commit into
mainfrom
agent/fix-orientation-listener-initial-values

Conversation

@mrousavy

Copy link
Copy Markdown
Owner

Summary

  • Emit the current orientation immediately when the existing iOS and Android managers start updates
  • Refresh Android interface orientation when subscribing
  • Clear retained native listener handles on stop and ignore queued stale Android callbacks
  • Reset the useOrientation snapshot when its source changes

Why

The managers could already know their current orientation before JavaScript subscribed, but only delivered later changes. If the device or interface did not rotate afterward, the hook could remain undefined or expose a stale value. Listener handles also remained retained after teardown in some paths.

This keeps the existing startOrientationUpdates / stopOrientationUpdates API and fixes the behavior in place.

Validation

  • bun camera typecheck
  • ./gradlew :react-native-vision-camera:compileDebugKotlin --no-daemon --console=plain
  • VisionCamera iOS simulator scheme build with xcodebuild
  • Focused Kotlin and Swift formatting checks
  • git diff --check

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-vision-camera-docs Ready Ready Preview Aug 12, 2026 6:31pm

Request Review

@mrousavy
mrousavy marked this pull request as ready for review August 12, 2026 18:59
@mrousavy
mrousavy merged commit c0374a2 into main Aug 12, 2026
7 of 9 checks passed
@mrousavy
mrousavy deleted the agent/fix-orientation-listener-initial-values branch August 12, 2026 19:05
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