Skip to content

debug(lotw): add dry-run .tq8 download endpoint for diagnostics#215

Merged
patrickrb merged 1 commit into
mainfrom
debug/lotw-dryrun-tq8
May 12, 2026
Merged

debug(lotw): add dry-run .tq8 download endpoint for diagnostics#215
patrickrb merged 1 commit into
mainfrom
debug/lotw-dryrun-tq8

Conversation

@patrickrb
Copy link
Copy Markdown
Owner

Summary

GET /api/lotw/dryrun-tq8?station_id=<id>[&limit=N] (or ?contact_id=<id>) builds the exact same signed .tq8 the real upload routes would POST to LoTW and returns it as a file download. Zero side effects — no upload log row, no contacts marked, no network call to LoTW.

Lets you save the .tq8 to disk and upload it manually via the LoTW web form (lotw.arrl.org/lotw/upload) to split the problem:

  • If the manual upload behaves the same way as our automated one (queues then disappears, no "Last upload" update) → the .tq8 content itself has a problem; we'll need to inspect the bytes.
  • If the manual upload works (Find Call timestamp moves to now) → our HTTP POST mechanics are the issue (multipart formatting, content-type, charset, something subtle), and the .tq8 build is fine.

Caps bulk dry-runs at 100 QSOs (default 5) so the inspection file stays small. Auth: same verifyToken + station-ownership check as the real upload.

Usage

After deploying, on Windows:

# Save the file (you'll need your nextlog session cookie active).
# Easiest: open this URL in your logged-in browser tab, it triggers a download.
https://<your-host>/api/lotw/dryrun-tq8?station_id=<your-K1AF-station-id>&limit=1

Then upload that file at https://lotw.arrl.org/lotw/upload and see what happens.

Test plan

  • GET /api/lotw/dryrun-tq8?station_id=X returns a .tq8 download
  • No row appears in lotw_upload_logs after calling it
  • lotw_qsl_sent flags on contacts unchanged after calling it
  • GET /api/lotw/dryrun-tq8?contact_id=Y returns a single-QSO .tq8
  • Returns 404 for someone else's station / 401 unauthenticated

🤖 Generated with Claude Code

GET /api/lotw/dryrun-tq8?station_id=<id>[&limit=N] (or ?contact_id=<id>)
builds the exact same signed .tq8 the real upload routes would POST to
lotw.arrl.org and returns it as a file download, with zero side effects:
no upload log row, no contacts marked, no network call to LoTW.

Lets the operator save the file, upload it manually via the LoTW web
form at lotw.arrl.org/lotw/upload, and isolate whether problems live in
the .tq8 content (manual upload fails the same way) vs. the HTTP POST
mechanics (manual upload works fine — multipart/charset/whatever).

Caps bulk dry-runs at 100 QSOs (default 5) so the inspection file stays
small. Authentication is the same as the real upload — verifyToken plus
station-ownership check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodelog Ready Ready Preview, Comment May 12, 2026 7:00pm

Request Review

@patrickrb patrickrb merged commit ca5a521 into main May 12, 2026
7 checks passed
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.

1 participant