Repository navigation
fix: read the resource UID when a nested alarm has its own UID - #858
Conversation
tobixen
left a comment
There was a problem hiding this comment.
Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5
Thanks for the disclosure, that part of the AI policy is met. The policy also discourages exactly this kind of contribution, though: #788 was filed with the analysis and a fix sketch already in it, so letting Codex implement it adds little I couldn't do myself with less effort than reviewing it.
Requesting changes:
- The cheap path is lost for most real-world events. The shortcut is only taken when exactly
BEGIN:VCALENDARandBEGIN:VEVENTprecede the UID. AnyVTIMEZONEbefore the event (which is what most clients write) addsBEGIN/END:VTIMEZONEandBEGIN/END:STANDARDlines, so every event with a timezone now falls back to the full parse. The result is still correct, but the shortcut exists for performance only. Track nesting instead: push onBEGIN, pop onEND, and accept the UID when the stack is[VCALENDAR, VEVENT|VTODO|VJOURNAL|VFREEBUSY]. - Add a test asserting that VTIMEZONE-first data still takes the shortcut, alongside
test_folded_uid_needs_no_full_parse. - Minor: check
"\\" not in uidbefore buildingheaders; it is computed and thrown away otherwise. - Please rebase on master; the failing async fallback jobs are fixed there (12ef8dd).
Codex reproduced issue python-caldav#788, implemented the fix and regression tests, and ran: python -m pytest -q tests/test_caldav_unit.py tests/test_async_davclient.py Assisted-By: OpenAI Codex (GPT-6)
Track open components before the UID, with parsed fallback for ambiguous structure. Add a VTIMEZONE-first test that disables the full parser. Assisted-By: OpenAI Codex (GPT-6)
cc1c33e to
71878ef
Compare
|
Thanks for pointing out the VTIMEZONE case. Commit 71878ef tracks which components are still open when the raw accessor reaches the UID. A preceding VTIMEZONE can now close before the event without triggering a full parse. Escaped UIDs go directly to the parser. The new regression test disables the full parser and checks a folded event UID after a VTIMEZONE. It failed before the change and passes now. The branch is also rebased onto master, including 12ef8dd. Codex assisted with the revision, tests, and this reply. |
|
Thanks for the rework. A fresh Opus 5.5 review found no correctness problems, but still some nits:
|
Address the follow-up review on python-caldav#858. Verified both unwrapped event cases failed before the change and all 775 unit tests pass after it. Assisted-By: Codex
Explain the NLnet GenAI policy situation: the project is committed to version 1.1, while version 2.0 only allows read-only use, and the policy will have to be revised if funding continues. Reword the "read this first" rules around contributors adding value, update the disclosure section beyond 3.3.1, and fix a batch of typos. The text is mostly the maintainer's own; the AI did QA and language fixes. Prompt: Can we piggy-back my uncommitted AI-POLICY-change into the same PR? Please do a QA on my changes. [moved to #869 instead of the contributor PR #858] Prompts (comments made inline in the document while reviewing it): Please fix up the findings. https://nlnet.nl/foundation/policies/generativeAI/2.0/ https://nlnet.nl/foundation/policies/generativeAI/1.1/ The project has been receiving funding since before the AI-policy was created, and we're currently committed to the version 1.1 of their AI-policy. Ok [to moving the NLnet paragraph into its own section] We're a bit in a twilight zone, as NLNet wants the 2.0-policy to be adapted. Followup-Prompt: I've amended a bit more (including re-adding that discarding NLnet funding may be considered), do the QA again, and push it into my PR. Do a review-and-merge of #858 also [#858] Assisted-By: Claude Opus 5.5 <noreply@anthropic.com> Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
Follow-up to #858. A component name with trailing whitespace ("BEGIN:VEVENT ") left the raw UID shortcut and made RawDataState.get_uid() return None; strip it. Also cover the rule that an earlier UID line the cheap regex skips (parameters, lowercase) sends the lookup to the full parser. Prompt: [fix issues found during the review process] Followup-Prompt: [merge the contributor's PR as is and do the review fixes in a commit of our own on top] Assisted-By: Claude Opus 5.5 <noreply@anthropic.com> Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
|
Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompt(s):
Thanks, merged in 150132f1. All five points from the previous round were addressed. A further clean-context review found no correctness problems, only nits. Rather than another round trip, they were fixed on top in 074399b5 (part of #869):
Left as is: unwrapped components (no |
Fixes #788. A reminder can have its own UID (RFC 9074 §4). When that property precedes the event UID, reading Event.id used to select the reminder. The regression covers both an event with its own UID and a missing event UID.
The raw accessor now uses its shortcut only when the preceding structure identifies the first resource component directly inside VCALENDAR. It delegates ambiguous cases to the existing parsed accessor. The existing folded-UID test still verifies the shortcut without a full parse.
Codex (GPT-6) reproduced the reported behavior, prepared the patch and ran the tests. On Python 3.12 the CalDAV unit and async-client suites passed (923 passed, 2 skipped). No live calendar was used.