Skip to content

suunto_nautic: stop foreach at a dive that failed to download - #7

Merged
latishab merged 1 commit into
mainfrom
fix/nautic-foreach-gap
Oct 4, 2026
Merged

latishab merged 1 commit into
mainfrom
fix/nautic-foreach-gap

Conversation

@latishab

@latishab latishab commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Problem

suunto_nautic_device_foreach skipped every dive whose download failed (a BLE link drop mid-/Data, an empty read of a listed dive, a refused stream after retries) and still returned DC_STATUS_SUCCESS. Hosts take their fingerprint from the newest delivered dive after a successful foreach, so the stored fingerprint moved past dives that were never fetched, and no later sync would pick them up.

Change

  • foreach stops at the first dive that fails and returns that status. The dives delivered before it are all newer (the walk is newest-first), so nothing older than the gap is ever reported as synced.
  • download_dive reports unreadable for a failure where the transfer completed and matched its listed size but holds no decodable dive (an empty/aborted logbook entry). Only those are still skipped, since downloading them again can't help.
  • A still-short dive (1.16.1 listed-size retry) is still delivered once with a warning: a delivered-but-incomplete dive isn't a gap.

Other families checked

Shearwater Petrel, Mares Icon HD, Pelagic i330R / Oceanic Atom2, EON Steel, OSTC3, Uwatec Smart, Halcyon Symbios, DiveSystem iDive, Seac Screen, Oceans S1, McLean, Divesoft, Cressi Goa, Deepblu, Deep Six. None skip a transport failure and return success. Their skips are device-declared permanent conditions (deleted, "unreadable", "not available", invalid header). EON Steel keeps going after a failed file read but does return the error at the end.

Tests are in libdc-swift (SuuntoNauticTransportTests, fake watch behind dc_custom_open).

🤖 Generated with Claude Code

foreach skipped any dive whose download failed and still returned
DC_STATUS_SUCCESS. Hosts store the newest dive's fingerprint after a
successful foreach, so a link drop mid-download moved the fingerprint
past dives that were never fetched, and no later sync picked them up.

Now foreach stops at the first dive that fails and returns its status,
having delivered only the newer dives. Only an entry whose transfer
completed and matched its listed size but holds no decodable dive (an
empty/aborted logbook entry) is still skipped. A still-short dive is
delivered once with a warning, as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@latishab
latishab merged commit 4554516 into main Oct 4, 2026
18 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