Code RoomPermission denial hangs location
MediumPrep Room Coding #4203

Permission denial hangs location

Vibe & agenticSecurityCode quality & reviewMid–Senior~15 min

An AI wrote this Flutter function to grab the user's location for a 'find nearby' feature. It works fine on the dev's phone where location is already granted, but testers report the app hangs forever or crashes when they tap the feature after denying the permission prompt. What's the bug and how would you catch it?

Implement
resolve_location_request(permission_status: str, service_enabled: bool, has_shown_rationale: bool) → str
Examples
in["whileInUse",true,false]out"fetch"
in["denied",true,false]out"show_rationale"
in["deniedForever",true,true]out"open_app_settings"
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 15 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.