Commit 7553af3
fix(sync): emit MHz frequency to LoTW + QRZ instead of dividing by 1M
contacts.frequency is numeric(10,6) and stores MHz directly — the column
precision can't physically hold Hz for HF (14.205 MHz in Hz is 14205000,
which needs 8 integer digits; the column allows 4). The form, ADIF import,
and QRZ download all write MHz.
Both upload paths assumed Hz and divided by 1_000_000:
LoTW (src/lib/lotw.ts): freqToMhz(14.205) = 0.000014 MHz
QRZ (src/lib/qrz.ts): (14.205 / 1000000).toString() = "0.0000142..."
For LoTW that produced a .tq8 whose canonical sign-string used the wrong
frequency. The signature still verified (same wrong value on both sides),
so LoTW accepted the upload and the app marked contacts lotw_qsl_sent='Y'.
LoTW then silently dropped each QSO because 0.000014 MHz isn't a valid
amateur frequency — uploads "succeeded" but nothing appeared on the LoTW
site. The author of #185 chased this confusion the wrong way in the
upload-route comment, inferring Hz from the QRZ uploader's matching bug.
Fix:
- Rename freqToMhz → formatFreqMhz, drop the /1_000_000 (input is MHz).
- Same for contactToQRZFormat in qrz.ts.
- Replace the misleading "stored in Hz" comment in the upload route.
After this lands, contacts uploaded with the bad frequency are still
marked lotw_qsl_sent='Y'/'qrz_sync_status'='synced' in the DB and won't
re-upload. PR description has a one-liner to reset them.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 08b31f4 commit 7553af3
3 files changed
Lines changed: 20 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 250 | + | |
| 251 | + | |
254 | 252 | | |
255 | 253 | | |
256 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
352 | 358 | | |
353 | 359 | | |
354 | 360 | | |
| |||
436 | 442 | | |
437 | 443 | | |
438 | 444 | | |
439 | | - | |
| 445 | + | |
440 | 446 | | |
441 | | - | |
| 447 | + | |
442 | 448 | | |
443 | 449 | | |
444 | 450 | | |
| |||
551 | 557 | | |
552 | 558 | | |
553 | 559 | | |
554 | | - | |
| 560 | + | |
555 | 561 | | |
556 | 562 | | |
557 | | - | |
| 563 | + | |
558 | 564 | | |
559 | 565 | | |
560 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
| |||
0 commit comments