fix(app): do not prompt location on HomePage open - #12190
Conversation
HomePage calls streamDeviceRecording with no device on every entry. That used to prompt for location when permission was denied, so a fresh-install deny-twice could lock the user in deniedForever. Gate requestPermission behind promptIfDenied; the no-device path stays check-only. Record and device start still prompt when denied. Failure-Class: none
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa7bce6598
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| unawaited(_conversationLocationCapture.captureAndUpload()); | ||
| // HomePage calls this with device == null on every entry — check-only so | ||
| // a fresh install cannot hit deniedForever before the user records. | ||
| unawaited(_conversationLocationCapture.captureAndUpload(promptIfDenied: device != null)); |
There was a problem hiding this comment.
Decouple homepage entry from device presence
When HomePage opens while DeviceProvider.connectedDevice is non-null (app/lib/pages/home/page.dart:502 passes that value), this expression evaluates to true and captureAndUpload requests location permission when it is denied. The flow this fix targets therefore still prompts connected-wearable users, and repeated denials can still move them to deniedForever; pass explicit homepage/check-only intent instead of inferring invocation purpose from device != null.
AGENTS.md reference: AGENTS.md:L47-L47
Useful? React with 👍 / 👎.
Follow-up to #12179 / Git-on-my-level 5411651527.
HomePage
streamDeviceRecording(device==null)was still prompting for location when permission was denied. A fresh-install deny-twice could lock the user indeniedForever.Now the no-device / HomePage path is check-only (
promptIfDenied: false). Record and device start still prompt when denied.Failure-Class: none
Test plan
flutter test test/unit/conversation_location_capture_test.dart)Note
Low Risk
UX-only gating of location prompts on home entry; record/device flows keep existing prompt behavior and fail-open skip when denied.
Overview
HomePage entry no longer shows the OS location permission dialog when permission is still denied. Opening home via
streamDeviceRecording(device == null)now calls conversation location capture in check-only mode (promptIfDenied: false).ConversationLocationCapture.captureAndUploadacceptspromptIfDenied(default true). If permission isdeniedand prompting is off, it skipsrequestPermissionand returns without uploading. Recording and device connect still passpromptIfDenied: trueso users who skipped onboarding location can be prompted at record start.deniedForeveris never re-prompted on either path.Unit and provider tests cover the homepage path, granted-permission uploads without prompts, and
deniedForeveron check-only.Reviewed by Cursor Bugbot for commit aa7bce6. Configure here.