Skip to content

[Bug]: QR pairing scanner dead-ends once camera access is denied #6486

Description

@hey-jj

Area

apps/mobile

Steps to reproduce

  1. Open the mobile app on iOS and go to Settings, then Environments.
  2. Tap the plus button to open Add Environment.
  3. Tap the QR icon in the header.
  4. In the system camera prompt, tap Don't Allow.
  5. Tap the QR icon again.

Expected behavior

The app offers a way back to the camera. When the system will not prompt again, the alert should point at the app's page in the system Settings app, the way the notification permission flow on the Settings screen already does.

Actual behavior

Step 5 shows a one-button alert titled "Camera access needed" with the body "Allow camera access to scan an environment pairing QR code." and an OK button. iOS never shows the permission prompt again, so every later tap repeats that same alert. Nothing inside the app can reach the camera after that. Android reaches the same state once the permission hits "don't ask again". The same screen still accepts a host and pairing code typed by hand, so pairing itself is not blocked. The QR path alone stays unusable.

The code path, read at main @ 9e20194:

  • apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx, openScanner awaits requestCameraPermission(). When canAskAgain is false the promise resolves denied without showing an OS prompt, and the function falls through to the one-button Alert.alert.
  • The fallback card on the same screen, "Camera permission is required to scan a QR code.", calls openScanner from its Allow camera button, so it reaches the same alert.
  • apps/mobile/src/features/settings/SettingsRouteScreen.tsx already covers this case for notifications. When canAskAgain is false it shows a two-button alert, Cancel and Open Settings, and Open Settings calls Linking.openSettings().

Impact

Major degradation or frequent failure

Version or commit

main @ 9e20194

Environment

iOS mobile app, apps/mobile. Behavior read from the code at main @ 9e20194.

Logs or stack traces

None. The failure is silent and produces no output.

Workaround

Turn camera access on for the app from the system Settings app, then reopen the scanner. Or type the host and pairing code by hand on the same screen.

Suggested fix: branch on the permission result's canAskAgain and reuse the Cancel and Open Settings alert already used for notifications. A small PR with that change accompanies this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions