M2-06: Collect location while a recording runs #33

Closed
opened 2026-08-08 19:56:52 -04:00 by agent · 0 comments
Member

Start a CLLocationManager when a recording starts, stop it when the recording stops, and hold the
points in memory. Nothing is written yet.

The rule that defines this issue

Nothing is written to disk unless a recording is running. Collection is tied to the recording
lifecycle, not to the app being open, not to the toggle being on. The toggle (M2-04) says may; a
running recording is what says now.

Wes: "collect only while recording a memo."

One named exception, added 2026-08-09. M2-10's heat map takes a location fix to centre itself,
only while that view is on screen, never written anywhere. That is a centring aid rather than
tracking, and it is the complete list of exceptions — if a second one is ever proposed, treat that
as the signal this rule is being eroded rather than extended.

Scope

  • Collection starts inside the same lifecycle that starts capture and ends with it, including the
    paths that end a recording without the stop button — the Live Activity stop, and a crash.
  • allowsBackgroundLocationUpdates so points keep arriving with the phone locked. This is the
    behaviour that matters; a track that stops the moment the screen locks is worthless for a walk.
  • Points buffered in memory and surfaced in Settings → Diagnostics, which is where the capture
    harness already reports what it just did. That is how this issue gets tested without a writer.
  • Accuracy setting appropriate to walking. Best-for-navigation is battery-expensive for a
    forty-minute memo and finer than a route needs.

What a point carries

Decided 2026-08-08: coordinates, time, horizontal accuracy, altitude, speed and course. All of
it comes free from CLLocation and none of it is recoverable once discarded, so nothing is
filtered at capture — consumers filter on accuracy downstream if they want to.

Time is the absolute instant of the fix, which is what GPX stores natively (decided 2026-08-09,
see #34). Alignment with VTT cue times is derived by subtracting the recording start rather than
stored, so there is no second copy of the same fact to disagree with itself.

What has to not happen

A location failure must never affect the recording. No authorization state, no CLError, no
absence of signal in a valley may stop, pause or degrade audio capture. The memo is the product;
the track is an annotation on it. If that separation cannot be held, say so and stop.

Done when

  • Recording with the toggle on collects points; Diagnostics shows them arriving.
  • Points keep arriving with the phone locked and in a pocket for a real walk.
  • Recording with the toggle off collects nothing and prompts for nothing.
  • Stopping the recording stops collection — verified by the indicator going away.
  • Denying location mid-recording does not disturb the audio.

Milestone 2 of the Stash v3 rebuild. M2 is still app-side — no sync, no account, no server. It
turns a list of memos into something you can open, listen to, read and see the route of. Sync
arrives in M3. There is no milestone/M2 label yet (creating org labels needs owner rights), so
the title carries the milestone.

Working agreement for every issue in this repo: feature branch, tested before the PR opens
(on-device where the label says so), then Wes reviews the PR and we walk the code together. Docs
update in the same commit. A PR that takes more than 20 minutes to review is too big — say so and
split it.

Start a `CLLocationManager` when a recording starts, stop it when the recording stops, and hold the points in memory. Nothing is written yet. ## The rule that defines this issue **Nothing is written to disk unless a recording is running.** Collection is tied to the recording lifecycle, not to the app being open, not to the toggle being on. The toggle (M2-04) says *may*; a running recording is what says *now*. Wes: *"collect **only while recording a memo**."* **One named exception, added 2026-08-09.** M2-10's heat map takes a location fix to centre itself, only while that view is on screen, never written anywhere. That is a centring aid rather than tracking, and it is the complete list of exceptions — if a second one is ever proposed, treat that as the signal this rule is being eroded rather than extended. ## Scope - Collection starts inside the same lifecycle that starts capture and ends with it, including the paths that end a recording without the stop button — the Live Activity stop, and a crash. - `allowsBackgroundLocationUpdates` so points keep arriving with the phone locked. This is the behaviour that matters; a track that stops the moment the screen locks is worthless for a walk. - Points buffered in memory and surfaced in **Settings → Diagnostics**, which is where the capture harness already reports what it just did. That is how this issue gets tested without a writer. - Accuracy setting appropriate to walking. Best-for-navigation is battery-expensive for a forty-minute memo and finer than a route needs. ## What a point carries **Decided 2026-08-08:** coordinates, time, horizontal accuracy, altitude, speed and course. All of it comes free from `CLLocation` and none of it is recoverable once discarded, so nothing is filtered at capture — consumers filter on accuracy downstream if they want to. Time is the **absolute instant of the fix**, which is what GPX stores natively (decided 2026-08-09, see #34). Alignment with VTT cue times is derived by subtracting the recording start rather than stored, so there is no second copy of the same fact to disagree with itself. ## What has to not happen A location failure must never affect the recording. No authorization state, no `CLError`, no absence of signal in a valley may stop, pause or degrade audio capture. The memo is the product; the track is an annotation on it. If that separation cannot be held, say so and stop. ## Done when - [ ] Recording with the toggle on collects points; Diagnostics shows them arriving. - [ ] Points keep arriving with the phone locked and in a pocket for a real walk. - [ ] Recording with the toggle off collects nothing and prompts for nothing. - [ ] Stopping the recording stops collection — verified by the indicator going away. - [ ] Denying location mid-recording does not disturb the audio. --- *Milestone 2 of the Stash v3 rebuild. M2 is still app-side — **no sync, no account, no server**. It turns a list of memos into something you can open, listen to, read and see the route of. Sync arrives in M3. There is no `milestone/M2` label yet (creating org labels needs owner rights), so the title carries the milestone.* *Working agreement for every issue in this repo: feature branch, tested before the PR opens (on-device where the label says so), then Wes reviews the PR and we walk the code together. Docs update in the same commit. A PR that takes more than 20 minutes to review is too big — say so and split it.*
wk closed this issue 2026-08-09 19:21:16 -04:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Stash/stash-ios#33
No description provided.