[GH-ISSUE #11] Handle sleep, relaunch, login startup and explicit pause #10

Open
opened 2026-10-23 18:09:15 +02:00 by jayanezj · 0 comments
Owner

Originally created by @jayanezj on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/jayanezj/traccar-client-macos/issues/11

Goal

Make tracking behaviour predictable on a laptop that sleeps, loses connectivity and is used intermittently.

Scope

  • Keep running when Settings closes or another app becomes foreground; Quit terminates acquisition, automatic sending and retries.
  • Do not prevent sleep or wake the Mac for capture, upload or queue cleanup. Preserve pending data.
  • If tracking was active before sleep, resume orderly after wake, without manufacturing sleep-period positions or launching a burst of retries.
  • On normal relaunch/login launch, default to paused. Provide a separate initially disabled preference to restore the previous tracking state. A saved explicit pause must remain a pause.
  • Provide initially disabled login startup using a supported native mechanism. Inspect actual macOS availability/permissions and report registration failures; do not add LaunchDaemons or mobile background modes by assumption.

Acceptance criteria

  • Closing Settings and locking the screen preserve the intended active state when the OS permits operation.
  • Pause cancels automatic acquisition, queue draining and retry timers while preserving data/settings.
  • Relaunch behaviour covers restoration off, restoration on with prior active state, and restoration on with prior paused state.
  • Login startup and tracking restoration are independent controls.
  • Wake/reconnect cannot create concurrent drain loops or send positions with substituted timestamps.
  • Sleep and Quit behaviour is recorded on an actual Mac, including any runtime limitations.

Validation

Combine deterministic lifecycle/state tests with a real-Mac close/lock/sleep/wake/relaunch checklist. Do not represent a timer simulation as proof of real sleep behaviour or measured battery consumption.

Add or extend this feature's meaningful deterministic tests in the CI workflow from PROTO-002 as part of the same implementation, without waiting for the final milestone. Keep physical-Mac checks explicitly manual.

Dependencies

Originally created by @jayanezj on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/jayanezj/traccar-client-macos/issues/11 ## Goal Make tracking behaviour predictable on a laptop that sleeps, loses connectivity and is used intermittently. ## Scope - Keep running when Settings closes or another app becomes foreground; Quit terminates acquisition, automatic sending and retries. - Do not prevent sleep or wake the Mac for capture, upload or queue cleanup. Preserve pending data. - If tracking was active before sleep, resume orderly after wake, without manufacturing sleep-period positions or launching a burst of retries. - On normal relaunch/login launch, default to paused. Provide a separate initially disabled preference to restore the previous tracking state. A saved explicit pause must remain a pause. - Provide initially disabled login startup using a supported native mechanism. Inspect actual macOS availability/permissions and report registration failures; do not add LaunchDaemons or mobile background modes by assumption. ## Acceptance criteria - [ ] Closing Settings and locking the screen preserve the intended active state when the OS permits operation. - [ ] Pause cancels automatic acquisition, queue draining and retry timers while preserving data/settings. - [ ] Relaunch behaviour covers restoration off, restoration on with prior active state, and restoration on with prior paused state. - [ ] Login startup and tracking restoration are independent controls. - [ ] Wake/reconnect cannot create concurrent drain loops or send positions with substituted timestamps. - [ ] Sleep and Quit behaviour is recorded on an actual Mac, including any runtime limitations. ## Validation Combine deterministic lifecycle/state tests with a real-Mac close/lock/sleep/wake/relaunch checklist. Do not represent a timer simulation as proof of real sleep behaviour or measured battery consumption. Add or extend this feature's meaningful deterministic tests in the CI workflow from [PROTO-002](https://github.com/jayanezj/traccar-client-macos/issues/2) as part of the same implementation, without waiting for the final milestone. Keep physical-Mac checks explicitly manual. ## Dependencies - [PROTO-010](https://github.com/jayanezj/traccar-client-macos/issues/10) <!-- planning-id: PROTO-011 -->
jayanezj added this to the M4 - Reliable tracking and persistence milestone 2026-10-23 18:09:15 +02:00
jayanezj added the area:trackingtype:featurepriority:high labels 2026-10-23 18:09:15 +02:00
jayanezj added type:feature and removed type:feature labels 2026-10-30 18:01:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jayanezj/traccar-client-macos#10