feat(adif): store the ADIF submode (FT4/JS8/PSK31) as the QSO mode on import#240
Merged
Merged
Conversation
… import WSJT-X, JTDX and JS8Call log the operating mode of a digital QSO as an ADIF SUBMODE beneath a generic parent MODE — FT4/JS8/FST4 under MFSK, PSK31 under PSK. The importer only read MODE, so every one of those QSOs was stored as "MFSK"/"PSK". The mode filter, mode statistics and charts treat FT4/JS8/PSK31 as first-class modes (they're in the search UI's mode list), so an FT4 run imported from WSJT-X silently dropped out of the FT4 filter and skewed stats. Add resolveAdifMode(mode, submode): promote the submode when present, except the voice sidebands (USB/LSB) which stay SSB so phone QSOs keep matching the SSB filter. Normalized to uppercase to match how modes are stored/exported. Backwards compatible: existing rows are untouched; only affects newly imported records. MODE-only imports (FT8, CW, RTTY, SSB) resolve exactly as before. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
WSJT-X, JTDX and JS8Call — the primary clients that post to Nextlog's ADIF import and
/api/qsoendpoint — log the operating mode of a digital QSO as an ADIFSUBMODEbeneath a generic parentMODE:<MODE:4>MFSK<SUBMODE:3>FT4MFSKFT4<MODE:4>MFSK<SUBMODE:3>JS8MFSKJS8<MODE:4>MFSK<SUBMODE:4>FST4MFSKFST4<MODE:3>PSK<SUBMODE:5>PSK31PSKPSK31The importer only read
MODE(fields.mode || fields.submode), so every one of those QSOs was stored under its generic parent. But the app treatsFT4,FT8,PSK31, etc. as first-class modes — they're in the search page's mode list, and the mode filter / mode statistics / charts group by the flatcontacts.modecolumn (there is no submode column). The result: an FT4 run imported from WSJT-X silently dropped out of the FT4 filter and showed up as a lump ofMFSK, skewing per-mode statistics.Solution
Add a small pure helper
resolveAdifMode(mode, submode)insrc/lib/adif.tsand use it when inserting a record:MFSK+FT4→FT4).USB/LSB, which staySSB— promoting them would split every phone QSO out of the SSB filter and phone stats.MODE, then toSSB, exactly as before when no usable submode exists.Backwards compatibility
MODE-only imports (FT8,CW,RTTY,SSB, …) resolve to the identical value they did before.contacts.modestays a flatvarchar. Export is unaffected (it already emits the flat stored mode, and the app already treats FT4/FT8 as top-level modes).Testing
tests/adif-mode.spec.ts(6 cases): submode promotion, USB/LSB → SSB, MODE-only fallback, uppercase/trim normalization, SSB default, and an end-to-endparseAdifRecords→resolveAdifModecheck on a verbatim WSJT-X FT4 record.adif-parse,adif-generate,adif-datetime,adif-mode) — 34 passed.npm run typecheckclean,eslintclean on touched files,npm run buildsucceeds.Future follow-up
MODE+SUBMODEpair on export for the strictest ADIF readers (FT4 is technically a submode of MFSK in the ADIF spec). Deferred because it needs a mode→parent lookup table and the current flat-mode export is already what the rest of the app assumes; LoTW/Cloudlog/N1MM all acceptMODE=FT4.🤖 Generated with Claude Code