[Bug]: iOS: camera stays active after leaving Add environment screen
Summary
On T3 Code (iOS, ALPHA), the camera used for the QR scanner on Add environment remains active after leaving that screen. The green iOS camera privacy indicator stays on on the main Threads screen, and Settings → Privacy reports Camera, a moment ago for T3 Code.
Expected
Camera access should stop when the Add environment flow is dismissed (back navigation or successful pairing), and no camera indicator should appear on unrelated screens.
Actual
After opening Add environment (QR scanner visible) and navigating back to Threads, the camera indicator remains on. This suggests the capture session is not torn down on unmount/blur.
Workaround: force-quit the app from the iOS app switcher. In-app navigation does not release the camera.
Reproduction
- Open T3 Code on iPhone.
- Go to Add environment (QR scanner area is shown).
- Navigate back to Threads without completing pairing (or after using manual entry).
- Observe the green camera dot in the status bar / Dynamic Island area.
- Open iOS Privacy controls — T3 Code still shows recent camera access.
- Force-quit the app — indicator clears.
Environment
- App: T3 Code ALPHA (iOS)
- Device: iPhone
- Date observed: 2026-10-22
Screenshots
See comment below (redacted: pairing fields, environment names, thread list content).
Notes
Likely fix: stop/release camera in screen cleanup (useEffect return), navigation blur handler (useFocusEffect), or when the scanner component unmounts.
Screenshots (redacted)
Sensitive fields are covered with opaque bars only (pairing address/code, camera preview, relay names, thread titles/repos). iOS privacy shot is cropped to the Privacidade → T3 Code → Câmara row.



Closing as not reproducible: on an iPhone 14 Pro (iOS 27.0) the camera indicator cleared after leaving Add environment (back, swipe-down, and successful pairing). The "Camera, a moment ago" entry in Settings → Privacy is expected after any scan. If this still happens, please reopen with your iOS version and app build. Related idea: https://github.com/pingdotgg/t3code/discussions/23880