8000 feat(data): preserve source-aware import identity by shroominic · Pull Request #68 · shroominic/OpenGlucose · GitHub
[go: up one dir, main page]

Skip to content

feat(data): preserve source-aware import identity - #68

Open
shroominic wants to merge 3 commits into
mainfrom
feature/issue-36-source-aware-spine
Open

shroominic wants to merge 3 commits into
mainfrom
feature/issue-36-source-aware-spine

Conversation

@shroominic
@shroominic shroominic commented Aug 23, 2026 •
Copy link
Copy Markdown
Owner

Summary

This is the first focused persistence slice for #89. It adds:

  • typed platform-scoped import identity and local-only source provenance for activity, sleep, and heart-rate samples;
  • deterministic de-duplication per sample family, platform, and external record ID;
  • retained typed deletion tombstones for source records that arrive without their original values or interval; and
  • an additive SQLite schema v1 → v2 migration with partial composite unique indexes.

Scope and exclusions

This PR deliberately does not close #89. It does not add native HealthKit/Health Connect readers, permissions, incremental anchors, app-lifetime repository wiring, source-priority/overlap policy, a unified UI timeline, or analytics. Those require separate focused work.

Risk

R2 — restricted health-data schema and public cgm_core persistence contract.

Source identifiers, device metadata, and revisions stay local-only. They are not added to exports, default UI, analytics, or logs.

Migration and rollback

  • v1 → v2 is additive: legacy rows remain readable and keep null identities.
  • The migration test verifies a v1 fixture survives intact and new imported records deduplicate after upgrade.
  • A prior v1 binary can read stored sample JSON but cannot preserve v2 identities on future imports. Do not continue imports after a downgrade; roll forward to a v2 build before importing again.

Verification

  • make format-check lint test-unit
  • flutter test test/sqflite_health_repository_test.dart
  • make build (Android debug and web artifacts produced)
  • enforced pre-push make check

Review focus

Please independently review the public data contract, source-identity validation, SQLite migration/index behavior, and the stated rollback boundary.

* feat(health): add bounded Apple Health context import

* fix(health): harden Apple Health import state

* feat(journal): add local fast diary

* fix(journal): isolate diary persistence and lifecycle

This branch has not been deployed

No deployments
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.

[Feature] Source-aware health data spine and import identity

1 participant

0