Phase 12: remove phone-relay dashcam upload feature

Removes the phone-relay feature entirely per the Phase 11 finding
that it hit a fundamental phone-OS limitation (a browser page can't
route WiFi and cellular traffic simultaneously, no code fix possible)
- see PLAN.md for the full test writeup.

- app.py: dropped /api/dash/pending, /api/dash/file/<path>,
  /api/dash/relay/config, /api/dash/relay/heartbeat,
  /api/dash/relay/stop, /api/dash/relay/mark_uploaded routes and
  their now-unused imports (os, send_file, abort, safe_join).
- modules/app_upload.py: dropped list_pending_dashcam_files(),
  relay_heartbeat()/relay_stop()/is_relay_active(),
  RELAY_LEASE_SECONDS/_relay_lease_until, and the relay-lease check
  inside _upload_dashcam_files()/get_status(). Kept the chunked
  upload protocol, dashcam_hash_cache/_hash_dashcam_file() (still
  used by the Pi's own background uploader), and DASHCAM_CHUNK_SIZE -
  none of that was relay-specific.
- templates/dash.html: removed the 'Relay via phone' card.
- static/js/dash.js: removed all relay JS (relayOneFile,
  fetchChunkWithRetry, uploadChunkWithRetry, heartbeat timers,
  pending-file list rendering).
- server/app.py: removed the CORS after_request hook, added solely
  for the phone's cross-origin browser calls (the Pi's own Python
  requests-based client was never subject to CORS).
- readme.md: dropped the phone-relay feature bullet, updated the
  project-status blurb to explain the removal + point at the planned
  native Android app as the real fix for that use case.
- PLAN.md: marked Phase 12 done with a verification writeup.

Verified: py_compile on all touched Python files, node --check on
dash.js, grepped all touched files for any leftover relay/RELAY
reference (none), and smoke-tested by importing app.py + hitting it
with Flask's test client - app starts cleanly, every relay route is
gone from url_map, and both / and /dash still render HTTP 200 with
zero 'relay' occurrences in /dash's HTML.

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-09 17:12:30 -04:00
co-authored by Copilot
parent 0b729adb28
commit f17c5c8681
7 changed files with 46 additions and 430 deletions
-20
View File
@@ -97,26 +97,6 @@
</p>
</div>
</div>
<div class="card shadow mt-4">
<div class="card-header py-3">
<p class="text-primary m-0 fw-bold">Relay via phone</p>
</div>
<div class="card-body">
<p class="text-muted small">
Open this page on your phone (while connected to the Pi's
hotspot/WiFi) to download pending dashcam files locally and
upload them straight to the remote server using your phone's own
data connection - useful when the Pi's own WiFi upload is slow.
Starting a relay automatically pauses the Pi's own background
dashcam upload so they don't compete for the same radio.
</p>
<p id="relay-status" class="mb-2">Checking...</p>
<button id="relay-refresh-btn" class="btn btn-secondary btn-sm" type="button">Refresh pending files</button>
<button id="relay-all-btn" class="btn btn-primary btn-sm" type="button" disabled>Relay all pending</button>
<button id="relay-stop-btn" class="btn btn-outline-danger btn-sm" type="button" disabled>Stop relay</button>
<ul id="relay-file-list" class="list-group mt-3"></ul>
</div>
</div>
</div>
</div>
<footer class="bg-white sticky-footer">