Fix overlapping period entries when logging an already-covered date#134
Merged
Conversation
… an ongoing period Tapping "Log Period" for a date that falls within an existing period's range (including an ongoing period extending through today) now opens that period for editing instead of creating a duplicate entry. https://claude.ai/code/session_01GExcjNDTjnVRYkCWDcr8sk
One-time backfill (gated by a preference flag, same pattern as the flow/symptoms backfills) that finds period entries with overlapping date ranges - including ongoing periods, which extend through today - and merges them into a single entry, combining notes and symptoms. This cleans up duplicates created by the overlap bug fixed in the previous commit for users who already hit it. https://claude.ai/code/session_01GExcjNDTjnVRYkCWDcr8sk
main landed 0.47.2-beta.1 for an unrelated slider fix while this branch was in progress. Renumber this branch's entries to 0.47.2-beta.2 and 0.47.2-beta.3 (versionCode 103/104) to avoid reusing a version string. https://claude.ai/code/session_01GExcjNDTjnVRYkCWDcr8sk
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
PeriodRepository.periodForDate()and routed both the calendar quick-log tap and the speed-dial "Log Period" action through it.Context
Reported scenario: logging a period starting 3 June with no end date ("ongoing"), then logging a period for 7 June, created two separate overlapping period entries instead of being treated as the same period. Since 3 June 7 is within the ongoing period's range (3 June through today), tapping "Log Period" for 7 June now edits the existing 3 June period instead of creating a duplicate.
Note: this fixes the entry point going forward. Any duplicate entries already created from this bug need to be manually removed via History.
Test plan
python3 a11y_check.pypasses (no new violations)https://claude.ai/code/session_01GExcjNDTjnVRYkCWDcr8sk
Generated by Claude Code