RawDataState.get_uid() returns a VALARM's UID when it comes before the event's own UID
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从caldav/datastate.py开始,将RawDataState.get_uid()与 issue 中描述的完整解析行为以及IcalendarState.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
- 平均合并
- 9 小时 21 分钟
- 30 天内合并 PR
- 77
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-caldav/caldav 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
python-caldav/caldav#844 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
python-caldav/caldav#792 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
python-caldav/caldav#687 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
python-caldav/caldav#847 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 56/100
python-caldav/caldav#842 ·
维护者通常 1 天内回复
查看 python-caldav/caldav 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 69/100
jejjohnson/gaussx#752 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
521xueweihan/HelloGitHub#4270 ·
-
enhancement owner: den-haag
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ok-oldking/ok-wuthering-waves#1828 ·
维护者通常 1 天内回复
-
lesson-submission pending-review
难度 1/5 1 小时以内 新手友好度 65/100
Ikalus1988/MisakaNet#4512 ·
维护者通常 1 天内回复