Repository navigation
Feature/wavelog sync pr - #1199
twicklund76 wants to merge 4 commits into
Conversation
accius
left a comment
There was a problem hiding this comment.
Thanks — this is a well-built addition. The separation of concerns is the right one: the browser owns the credentials and the cursor, the server only proxies and rings the MQTT doorbell, and the cursor advances only after the native logbook has persisted, with the strict rollback in addMany making a failed import safe to retry. The SSRF guard already covers the new pull endpoint, MQTT is already a dependency, tests are included and CI is green.
Two things I'd like changed before merging, and a few notes.
1. The first pull will time out on a big log. syncWavelogQsos asks for one page of 5000 QSOs through fetchWithTimeout, which uses the 20 s PUSH_TIMEOUT_MS. Wavelog generating 5000 ADIF records can take longer than that on a modest host, and a log larger than 5000 needs repeated "Sync now" clicks to walk the cursor forward (the hook loop only re-runs on events, not on a full page). Suggest: loop in syncWavelogQsos while exportedQsos === limit (cursor advances each page, so it is safe), and give the pull endpoint its own longer timeout (60 s?). A smaller page (1000–2000) would help too.
2. Update the header comment in server/routes/logsync.js (line 14) — it still documents POST …/api/station_info {key} while the code now uses GET …/api/station_info/<key>. The change itself is right: both Wavelog and Cloudlog document the GET form, so this quietly fixes the Test button. Worth a line in the PR description since it changes existing behaviour.
Notes, no change needed
connectWavelogMqttis started lazily by the first SSE client and never torn down; fine for a long-running server, and the reconnect period handles broker restarts.- The SSE endpoint ends immediately when MQTT isn't configured, so on the hosted site this is one short request per page load for users with pull enabled. Good.
- The API key goes into the URL for
station_info; that's inherent to the Wavelog/Cloudlog API, but it will appear in their access logs. Nothing to do here. - Map-layer updates are best-effort and can't block the cursor — good call.
Once (1) and (2) are in I'll merge this to Staging for the next release. 73 de K0CJH
What does this PR do?
Adds Wavelog pull synchronization to OpenHamClock's native logbook.
This complements the existing Wavelog/Cloudlog push integration by allowing OpenHamClock to import QSOs from Wavelog for native logbook features such as worked-before tracking and awards.
The integration:
The initial historical import remains an explicit user action via "Sync now". Automatic event synchronization only begins after a Wavelog cursor exists.
Native logbook persistence completes before the Wavelog cursor advances, so a failed local write cannot cause QSOs to be skipped on the next pull. Map-layer updates are best-effort and do not affect the synchronization cursor.
The optional MQTT configuration is documented in the Docker documentation and environment example.
Tested with Wavelog 3.0.1, including an initial 930-QSO import, subsequent incremental pulls, live event-triggered synchronization, map-layer updates, and reconnect catch-up.
Automated validation:
npm run test:run— 110 test files passed; 1631 tests passed, 3 skipped, 12 todonpm run format:check— passednpm run lang:check— passedgit diff --check— passedType of change
How to test
Checklist
server.js: caches have TTLs and size caps (we do not modifyserver.js)Cache-Control: no-cache; optional MQTT configuration and disconnect/reconnect behavior are handled)var(--accent-cyan), etc.).bak,.old,console.logdebug lines, or test scripts includedScreenshots (if visual change)
Wavelog pull configuration in Logbook Sync:
