Conversation
Dives imported before GF extraction existed have NULL gf_low/gf_high (and related metadata), and fingerprint dedupe meant re-importing the same Shearwater Cloud .db skipped them without ever backfilling — so the replay sheet fell back to 30/70 defaults. Re-imports of already-known dives now backfill nil-only metadata fields (GF low/high, deco model, salinity, surface pressure, end GF99) from the source row. Existing values are never overwritten, and the binary log is only re-parsed when at least one field is missing. New divesBackfilled counter on the import result surfaces the activity. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ckfill - backfillMissingMetadata no longer short-circuits a dive after its first update — a second computer's row in the same group can fill fields the first row couldn't (matches first-non-nil-across-rows merge semantics) - Partial-merge path now backfills the existing dive after the merge write, so newly added fingerprints resolve and the new computer's row can fill gaps - Tests for both cases Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
Second-opinion review (gpt-5.3-codex) — no blockers → addressed in latest commitShould-fixes (both addressed):
Confirmed correct by review: legacy fingerprint fallback, nil-only updates (never overwrites), transaction safety, source-compatible Full Swift suite green, SwiftLint clean. |
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.
Summary
NULL gf_low/gf_high. Fingerprint dedupe made this permanent: re-importing the same Shearwater Cloud.dbskipped existing dives entirely, so old rows could never be repaired — and the replay sheet fell back to its 30/70 defaults.divesBackfilledcounter toShearwaterCloudImportResult(defaulted, source-compatible).User action to repair existing data: re-export from Shearwater Cloud and re-import the
.db— affected dives will be backfilled in place.Closes PRO-62.
Tests
testReimportBackfillsMissingMetadata— first import populates, fields nulled to simulate an old import, re-import restores them (divesBackfilled == 1, no duplicate dives)testReimportDoesNotBackfillWhenNothingMissing— fully populated dives are untouched and existing values are never overwritten (divesBackfilled == 0)Made with Cursor