Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

RawDataState.get_uid() returns a VALARM's UID when it comes before the event's own UID

オープン 初心者向け
#788 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

caldav/datastate.pyから始め、Issueで説明されている完全な解析時の動作およびIcalendarState.get_uid()の動作と、RawDataState.get_uid()を比較してください。アラームがイベントより前にあるUIDの例を再現し、その後、未加工UIDの検索に関する既存のテストを確認してください。この例で未解析のアクセサーがevent-1を返し、解析後のアクセサーと一致すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompts:

Do a review of PR#787
[file the finding found]


RawDataState.get_uid() (caldav/datastate.py), the cheap accessor behind .id of an object that is not parsed yet, takes the first line matching ^UID: anywhere in the data. RFC 9074 section 4 allows a UID inside a VALARM, so if the VALARM comes before the event's own UID line, .id returns the alarm's UID:

BEGIN:VCALENDAR
BEGIN:VEVENT
BEGIN:VALARM
UID:alarm-1
ACTION:DISPLAY
TRIGGER:-PT5M
END:VALARM
UID:event-1
DTSTART:20260101T000000Z
END:VEVENT
END:VCALENDAR

RawDataState(data).get_uid() returns alarm-1. The full-parse fallback (DataState.get_uid()) and IcalendarState.get_uid() only look at VEVENT/VTODO/VJOURNAL/VFREEBUSY, and return event-1 — so .id changes once the object gets parsed.

The consequences are those fixed for folded UIDs in https://github.com/python-caldav/caldav/pull/787: get_object_by_uid() filters out the right object, save(no_overwrite=True) / save(no_create=True) check the wrong UID. Most clients write the UID before any VALARM, so this is likely rare in practice.

A possible fix: only accept a UID: line when no BEGIN:VALARM (or any other subcomponent) is open at that point, or fall back to the full parse whenever the data contains BEGIN:VALARM before the first UID:.

主要言語
Python
スター
412
フォーク
113
平均マージ
11時間 37分
マージ済み PR(30日)
50

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python-caldav/caldav のほかの issue

python-caldav/caldav の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。