Repository navigation
Handle one-sided date ranges and date-only end dates consistently - #249
Merged
Merged
Conversation
messages_fetch applied a date range only when both start and end were given, so start alone was ignored. Each bound now applies on its own, and an end before the start matches nothing instead of trapping. A date-only end already includes that whole day in messages_fetch, events_fetch, and reminders_fetch, but the descriptions said it uses local midnight. The descriptions now say so, and phone_calls_fetch normalizes date-only start and end values the same way.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Invalid message date inputs can be silently ignored instead of rejected.
Review effort: Lite
Findings: 1
What changed in this PR
Updates date-range handling and date-only documentation across message, phone, calendar, and reminder fetch services.
Changes:
- Supports one-sided message date ranges.
- Normalizes phone date-only bounds.
- Clarifies date-only end-date behavior.
- Messages still need explicit validation for invalid date inputs.
| File | Changes |
|---|---|
App/Services/Reminders.swift |
Updated end-date documentation. |
App/Services/Phone.swift |
Normalized date-only bounds. |
App/Services/Messages.swift |
Added independent date bounds and open-range handling. |
App/Services/Calendar.swift |
Updated end-date documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
An unparseable start or end was dropped silently, which widened the range instead of reporting the mistake.
When completed was omitted, reminders_fetch fetched every reminder in the lists and ignored start and end. With a date range, it now fetches incomplete reminders by due date and completed ones by completion date, as the two explicit modes do.
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.

messages_fetchapplied a date range only when bothstartandendwere given, so a call withstartalone ignored it and returned messages from years earlier. This PR applies each bound on its own. The open end uses a date that fits the Int64 nanosecondschat.dbuses, anendbefore thestartmatches nothing instead of trapping, and astartorendthat is not an ISO 8601 string is rejected instead of dropped.reminders_fetchhad the same gap: withoutcompleted, it ignoredstartandendand returned every reminder. With a date range, it now returns incomplete reminders by due date and completed ones by completion date, as the two explicit modes do.A date-only
endalready includes that whole day inmessages_fetch,events_fetch, andreminders_fetch, but the descriptions said it uses local midnight or said nothing. The descriptions now say that a date-only value includes that whole day.phone_calls_fetchused a date-onlyendas midnight, which left that day out, so it now normalizes date-onlystartandendvalues like the other tools.