From 1c8156b42728965fe4f256e99e6e3408b77cf88b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Dec 2025 14:09:37 +0000 Subject: [PATCH 1/3] Initial plan From db7ffff5a4644d5f685db51c6d2167fc65dafd6d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Dec 2025 14:12:52 +0000 Subject: [PATCH 2/3] Fix distance display updates and add debug logging for GPS tracking Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- content/wardrive.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/content/wardrive.js b/content/wardrive.js index eac1eb9..8a2c58b 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -343,13 +343,22 @@ async function releaseWakeLock() { // ---- Geolocation ---- async function getCurrentPosition() { + if (DEBUG_GPS_LOGGING) { + console.log("[GPS] Requesting current position"); + } + return new Promise((resolve, reject) => { if (!("geolocation" in navigator)) { reject(new Error("Geolocation not supported")); return; } navigator.geolocation.getCurrentPosition( - (pos) => resolve(pos), + (pos) => { + if (DEBUG_GPS_LOGGING) { + console.log(`[GPS] Got current position: ${pos.coords.latitude.toFixed(5)}, ${pos.coords.longitude.toFixed(5)}, accuracy: ±${Math.round(pos.coords.accuracy)}m`); + } + resolve(pos); + }, (err) => reject(err), { enableHighAccuracy: true, @@ -406,6 +415,7 @@ function startGpsAgeUpdater() { if (state.gpsAgeUpdateTimer) return; state.gpsAgeUpdateTimer = setInterval(() => { updateGpsUi(); + updateDistanceDisplay(); // Also update distance from last ping }, 1000); // Update every second } @@ -420,6 +430,10 @@ function startGeoWatch() { if (state.geoWatchId) return; if (!("geolocation" in navigator)) return; + if (DEBUG_GPS_LOGGING) { + console.log("[GPS] Starting continuous GPS watch"); + } + state.gpsState = "acquiring"; updateGpsUi(); startGpsAgeUpdater(); // Start the age counter @@ -433,7 +447,13 @@ function startGeoWatch() { tsMs: Date.now(), }; state.gpsState = "acquired"; + + if (DEBUG_GPS_LOGGING) { + console.log(`[GPS] Position updated: ${pos.coords.latitude.toFixed(5)}, ${pos.coords.longitude.toFixed(5)}, accuracy: ±${Math.round(pos.coords.accuracy)}m`); + } + updateGpsUi(); + updateDistanceDisplay(); // Update distance when GPS position updates }, (err) => { console.warn("watchPosition error:", err); From ffda95103e4f26e508b8f82205b8d7988e0e07f6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Dec 2025 14:15:36 +0000 Subject: [PATCH 3/3] Fix auto ping not rescheduling when GPS fix unavailable Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- content/wardrive.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/wardrive.js b/content/wardrive.js index 8a2c58b..0b14a63 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -629,8 +629,10 @@ async function sendPing(manual = false) { // Auto mode: use GPS watch data if (!state.lastFix) { // If no GPS fix yet in auto mode, skip this ping and wait for watch to acquire location - console.warn("Auto ping skipped: waiting for GPS fix"); - setStatus("Waiting for GPS fix...", "text-amber-300"); + if (DEBUG_GPS_LOGGING) { + console.warn("[GPS] Auto ping skipped: waiting for GPS fix"); + } + handlePingSkip("Waiting for GPS fix...", manual); return; } lat = state.lastFix.lat;