M2-06: Collect location while a recording runs #47
No reviewers
Labels
No labels
area/agent
area/capture
area/editor
area/geo
area/security
area/sync
area/transcription
area/ui
area/vault
area/voice-memos
blocked
milestone/M1
milestone/M2
milestone/M3
milestone/M4
needs-decision
needs-hardware
p0
p1
p2
type/bug
type/enhancement
type/feature
type/idea
type/infrastructure
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Stash/stash-ios!47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "m2-06-location-collection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #33.
Starts a
CLLocationManagerat the instant a recording is running and stops it at the top ofstop(). Points are held in memory and shown in Settings → Diagnostics; nothing is written todisk, which is #34.
What it does
Nothing is collected unless a recording is running. M2-04 chose Always authorization, so iOS is
no longer what enforces that — it is a promise only this code keeps. Collection begins in
markRunning, before the first await, because a stop arriving inside that suspension wouldotherwise be followed by collection starting for a recording that had already ended.
Every way consent can end arrives on one path. The toggle, a revocation in iOS Settings, a
restriction and a denial at the prompt all stop the manager and drop what that recording collected.
Handling the
CLErroralone would miss the toggle; handling the toggle alone would miss arevocation.
A fix taken before the recording began is refused.
startUpdatingLocation()can deliver acached one, and a point from ten minutes earlier is exactly what the rule forbids.
Core Location's sentinels are decoded, not carried. A negative
speed,courseor accuracymeans "could not measure", and a negative
horizontalAccuracymeans the coordinates are invalid —that fix never becomes a point. Nothing else is dropped; accuracy filtering stays downstream.
The rules live in
TrackSession, a value, so the privacy behaviour is unit tests rather than a walkwith a phone.
LocationConsentandLocationUpdatingare seams for the same reason.The route-repair half of
AudioRecordermoved into an extension in the same file — the class wentthree lines over the type-body limit, and that half is where the growth was.
Decisions from Wes, 2026-08-09
the indicator. What Always buys is that it is absent when no recording is running.
superseding M2-04's
disable()comment about affecting only recordings that have not started.Codex
Four passes, artifacts in
.agent/m2-06-location-collection/. No critical findings in any.The ones that changed the code: reduced accuracy plus the stale-fix rule can leave a short memo with
no route (the Settings sentence now says so);
speedAccuracyandcourseAccuracywere not beingconsulted;
spanread the ends of the array rather than the extremes, which is wrong when CoreLocation delivers a fix late; and the app-switcher snapshot would have written the last coordinate
to disk, outliving the app it was promised to die with.
The test round found two real bugs, both fixed and pinned: a recording made with the opt-in off
showed the previous recording's route, and a
CLError.deniedthat outran the authorization changeleft updates running.
SUMMARY.mdcarries every finding with its disposition, including the rejections.Validated
435 tests, 41 suites, passing.
make lintclean. On the device: recording with the toggle oncollects points, the blue location indicator appears, and it goes away at stop.
Not validated
CoreLocationUpdateshas no unit test — every collector test replaces it, so a no-opstartCollectingwould pass the whole suite and collect nothing on a phone. The device pass isthe only evidence it works.
AudioRecordercall sites are not covered. The ordering argument forbeginsitting beforethe await is reasoning and a comment, not a test;
AudioRecorderneeds an audio session and amicrophone, which
AGENTS.mdkeeps out ofStashTests.route is derived from the stale-fix rule rather than observed.
covered by unit tests through the real collector, not by hand.