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.
fix(jmap): correctness fixes + dedup from June 2026 review #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
fix(jmap): correctness fixes + dedup from June 2026 review #688
Changes from all commits
0204af4File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring now says "callers must convert UTC datetimes to the event's local timezone before calling if the event uses TZID" but none of the three callers in
ical_to_jscal.pyactually do that (at lines 100, 163, and 312 of that file). I ran it to confirm the data bug:The round-trip back through
jscal_to_icalproducesUNTIL=20240701T120000with no Z suffix, which RFC 5545 §3.3.10 forbids for TZID events. The recurrence series ends two hours early for UTC+2 users. The same applies atical_to_jscal.py:163when an EXDATE is expressed in UTC on a TZID event, though that form is less common since most clients emit EXDATE with the TZID parameter matching DTSTART.The fix is to thread the event timezone into
_rrule_to_jscaland_exdate_to_overridesso they can calldt.astimezone(ZoneInfo(tz)).replace(tzinfo=None)before_format_local_dt. The timezone is already extracted atical_to_jscal.py:64fromdtstart_prop.params.get("TZID")but is not passed to either helper. I would keep this in the same PR rather than deferring it since the UNTIL case is silent data corruption on a common event pattern.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue:
_STATUS_ICAL_TO_JSCALis rebuilt on every call. Should be a module-level constant alongside_CLASS_MAP,_PARTSTAT_MAP, etc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The STATUS mapping dict is defined inside the
if status:block on every call. Every other mapping in this file (_PRIVACY_TO_CLASS,_FREE_BUSY_TO_TRANSP,_PARTSTAT_MAP,_KIND_TO_CUTYPE) is a module-level constant. Non-blocking, but inconsistent with the rest of the file. Hoist_STATUS_JSCAL_TO_ICALto module level and simplify this block to:Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.