Skip to content

fix: keep a calendar's own VTIMEZONE over the generated one - #341

Merged
abe-101 merged 2 commits into
mainfrom
fix/keep-source-vtimezone
Nov 8, 2026
Merged

abe-101 merged 2 commits into
mainfrom
fix/keep-source-vtimezone

Conversation

@abe-101

@abe-101 abe-101 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

If you merge a TeamSnap feed, the output loses its RRULE VTIMEZONE and gets a generated RDATE one instead. Outlook shows those events an hour late after DST ends.

This happens with any calendar that has both X-WR-TIMEZONE and its own VTIMEZONE. to_standard() puts a generated VTIMEZONE ahead of the calendar's own, and merge() keeps the first one per TZID. Now the calendar's own wins.

The new test without the fix. Each tuple is (block, has RRULE, has RDATE):

>   assert observances == [("DAYLIGHT", True, False), ("STANDARD", True, False)]
E   At index 0 diff: ('STANDARD', False, False) != ('DAYLIGHT', True, False)
E   Left contains one more item: ('STANDARD', False, True)

The fixture is trimmed from an anonymized copy of a real feed.

I haven't confirmed this fixes Outlook yet, only that the output keeps TeamSnap's definition.

Merging this releases 0.6.2.

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/mergecal/calendar_merger.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@abe-101
abe-101 force-pushed the fix/keep-source-vtimezone branch from 80a63c8 to 9385e3d Compare November 3, 2026 21:27
A TeamSnap feed publishes a correct RRULE VTIMEZONE, but merged output
carries the generated RDATE one instead. Fails until the next commit.

Assistant-model: Claude Code
Merged output lost the calendar's RRULE definition whenever X-WR-TIMEZONE
was set. Outlook shows those events an hour late after DST ends.

Assistant-model: Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the change to preserve source timezone definitions.

No open issues 🎉

What changed in this PR

Preserves a source calendar’s own VTIMEZONE when normalization generates another definition with the same TZID. This addresses the reported TeamSnap timezone replacement; the Outlook behavior remains unverified.

Changes:

  • Reverses timezone traversal so the source definition takes precedence over the generated one.
  • Adds a TeamSnap fixture and regression test checking that recurrence rules, timezone content, and event start time are preserved.
File Description
tests/​test_issue_1_include_timezones.py Adds regression coverage for preserving the source timezone definition.
tests/​calendars/​teamsnap_x_wr_timezone.ics Adds a TeamSnap fixture containing both X-WR-TIMEZONE and VTIMEZONE.
src/​mergecal/​calendar_merger.py Reverses timezone traversal before deduplicating by TZID.

Review effort: Balanced

@abe-101

abe-101 commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@niccokunzmann Let me know if you plan to review this; otherwise I'll just merge it (I'll wait 24 hours for a response)

@abe-101
abe-101 merged commit d87c7af into main Nov 8, 2026
21 checks passed
@abe-101
abe-101 deleted the fix/keep-source-vtimezone branch November 8, 2026 18:14

This branch was successfully deployed

1 active deployment
release — c4384a44 Deployed Nov 3, 2026 by abe-101 via release #910
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.

2 participants