Repository navigation
fix: prefer rear camera by default - #29
Merged
Merged
Conversation
✅ Deploy Preview for qrss ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Fixes #26
Root cause
Scan.vuepickedcameras[0]fromenumerateDevices()(arbitrary order, often the front camera on phones), persisted it to localStorage, and passed it to qr-scanner as an exactdeviceIdon every visit — overriding qr-scanner's'environment'default. Extra permission prompts came fromuseDevicesList({ requestPermissions: true })opening its own stream, plus the scanner being recreated on every camera change.Changes
facingMode: environment; only an explicit user pick is persisted (new keyqrs-camera-choice, legacyqrs-selected-camerais removed so users with an auto-saved front camera get the rear one again). Stale stored ids are cleared once enumeration proves they're gone.facingMode(prefers iPhone "Back Triple/Dual Wide" virtual devices that auto-switch to macro; skips ultra-wide/telephoto).setCamera().createCameraQueue) with a generation counter, so overlapping start/switch can't leak streams or override the user's choice; disposed on unmount (also fixes a pre-existing leak when unmounting during the scan-speed rebuild).utils/camera.ts, covered bytest/camera.test.tsandtest/camera-queue.test.ts.Verification
pnpm run lint,vue-tsc,pnpm run generate: passtest/slicing.test.tssnapshot andpackages/generateresolve failures are pre-existing onmainand fixed separately in the dependency-update branch.Manual QA checklist