Skip to content

Keep dive computer BLE identities device-local#682

Open
mikecarr wants to merge 1 commit into
submersion-app:mainfrom
mikecarr:fix/dive-computer-local-ble-identity
Open

Keep dive computer BLE identities device-local#682
mikecarr wants to merge 1 commit into
submersion-app:mainfrom
mikecarr:fix/dive-computer-local-ble-identity

Conversation

@mikecarr

Copy link
Copy Markdown
Contributor

Summary

Addresses #645, where the same physical dive computer can appear as separate records on different Apple devices.

CoreBluetooth identifiers are host-specific, so the synced bluetoothAddress must not be used as the computer identity. This PR:

  • Keeps BLE addresses local to each device and excludes them from sync export/import.
  • Prevents incoming records or conflict resolution from overwriting a local BLE address.
  • After a newly discovered computer downloads successfully, matches it by manufacturer, model, and serial number and rebinds the current device-local address to the existing record.
  • Creates a new record when the stable hardware identity is genuinely new.

This handles the Petrel 3/ssss scenario without conflating computers of the same model with different serial numbers. Existing duplicate records are not automatically merged by this PR.

Validation

  • flutter test test/features/import_wizard/data/adapters/dive_computer_adapter_test.dart
  • flutter test test/core/services/sync/sync_serializer_fetch_record_test.dart
  • dart analyze on all changed implementation and test files
  • git diff --check

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build artifacts for this PR · commit 93ff44e

Platform Download
Android (APK) android-apk
macOS macos-build
Windows windows-build
Linux linux-build

Artifacts expire in 7 days. Downloading requires being signed in to GitHub. The macOS build is ad-hoc signed — right-click → Open on first launch.

Updated automatically on each push.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.00000% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ta/repositories/dive_computer_repository_impl.dart 0.00% 15 Missing ⚠️
lib/core/database/database.dart 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant