Skip to content

Add live countdown for GPS skip in auto-ping mode#50

Merged
MrAlders0n merged 5 commits intodevfrom
copilot/fix-gps-data-skipping-issue
Dec 18, 2025
Merged

Add live countdown for GPS skip in auto-ping mode#50
MrAlders0n merged 5 commits intodevfrom
copilot/fix-gps-data-skipping-issue

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

When auto-ping skips due to stale GPS (after refresh timeout), the status previously showed a static message then reverted to generic text without countdown, obscuring that auto-ping remained active.

Changes

  • Track skip state: Added skipReason to state, set to "gps too old" when GPS refresh fails
  • Conditional countdown display: Show "Skipped (gps too old), next ping (Xs)" with live countdown and warning color when skip occurs; normal countdown otherwise
  • Enhanced countdown timer: Support object return format {message, color} alongside existing string format
  • Lifecycle management: Clear skipReason on auto-ping start/stop and before next attempt

Implementation

// Countdown message generator now returns color-coded objects
if (state.skipReason) {
  return { 
    message: `Skipped (${state.skipReason}), next ping (${remainingSec}s)`,
    color: STATUS_COLORS.warning  // Amber background
  };
}
return { 
  message: `Waiting for next auto ping (${remainingSec}s)`,
  color: STATUS_COLORS.idle  // Gray background
};

GPS refresh failure path:

try {
  return await acquireFreshGpsPosition();
} catch (e) {
  state.skipReason = "gps too old";  // Triggers skip countdown
  return null;
}

Screenshots

Normal countdown (gray):
Normal

GPS skip countdown (amber):
Skip

Original prompt

In the previous PR (“Add GPS status feedback and freshness validation for ping operations”) auto‑ping behavior is mostly correct, but there’s a minor status/UX issue when GPS data is stale.

Problem

  • In auto ping mode, if GPS data is too old, the UI correctly shows:
    "GPS data old, trying to refresh position"
  • However, after the refresh attempt times out, the status reverts to:
    "waiting for next ping"
  • This makes it look like the ping succeeded (or wasn’t skipped), when in fact it was skipped due to stale GPS.

Requested change

  • When an auto ping is skipped because GPS is too old (including after a refresh attempt times out), the status should explicitly indicate the skip and then show the next scheduled attempt with a countdown.

Desired status text (exact wording)

  • "Ping skipped, gps too old. waiting for next ping (30s)"

Countdown behavior

  • The "30s" value should be a live countdown to the next auto‑ping interval (decrementing each second until the next attempt).
  • This ensures the user understands:
    1. the ping did not occur (it was skipped/failed due to stale GPS), and
    2. auto‑ping is still running and will try again at the next interval.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 18, 2025 19:11
- Add skipReason state to track when ping is skipped
- Update countdown timer to support color-coded messages
- Show "Ping skipped, gps too old. Waiting for next auto ping (Xs)" with live countdown
- Clear skip reason on auto ping start/stop and next ping attempt
- Display skip message in warning color to indicate issue

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Change from "Ping skipped, gps too old. Waiting for next auto ping (30s)"
to "Skipped (gps too old), next ping (30s)" for more compact display

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Extract applyCountdownStatus helper function to handle both string
and object return formats, reducing duplication in update() method

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Document applyCountdownStatus parameters and clarify skipReason
is an internal value for security review

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GPS status feedback for skipped auto ping Add live countdown for GPS skip in auto-ping mode Dec 18, 2025
Copilot AI requested a review from MrAlders0n December 18, 2025 19:20
@MrAlders0n MrAlders0n marked this pull request as ready for review December 18, 2025 19:20
@MrAlders0n MrAlders0n merged commit e2946de into dev Dec 18, 2025
@MrAlders0n MrAlders0n deleted the copilot/fix-gps-data-skipping-issue branch December 19, 2025 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants