Repository navigation
suunto_nautic: stop foreach at a dive that failed to download - #7
Merged
Merged
Conversation
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>
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
suunto_nautic_device_foreachskipped 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 returnedDC_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
download_divereportsunreadablefor 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.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 behinddc_custom_open).🤖 Generated with Claude Code