Skip Google Health weight sync for days with an existing manual entry - #2
Merged
Merged
Conversation
Google Health sync previously deduped only by exact recorded_at timestamp or data point ID, so a manually-entered weight and a Google-synced weight for the same calendar day (recorded at different times) created two rows instead of one. Backfill now skips a Google weight data point for any date that already has a manual entry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZjN6b2GQSeeSDcV22VEhh
… past dupes Generalize the per-day dedup check (previously manual-only) to skip a Google weight/height entry whenever any entry already exists for that calendar day, preventing Google-to-Google duplicates within a sync run in addition to manual/Google duplicates. Add a one-time data migration that removes duplicate weight/height entries created before this fix: per user/day, keep the manual entry if one exists, otherwise keep the entry with the latest recorded_at, and delete the rest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZjN6b2GQSeeSDcV22VEhh
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.
Google Health sync previously deduped only by exact recorded_at
timestamp or data point ID, so a manually-entered weight and a
Google-synced weight for the same calendar day (recorded at different
times) created two rows instead of one. Backfill now skips a Google
weight data point for any date that already has a manual entry.
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01EZjN6b2GQSeeSDcV22VEhh