Collation: accent-insensitive and locale-aware searches must be decided client-side
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with CalDAVSearcher.add_property_filter(), which overrides the signature without accent_sensitive, then _build_search_xml_query and _collation_to_caldav, which decide what goes on the wire. The first step is the research the issue asks for: check how real CalDAV servers match the collations, using caldav-server-tester. Done means that positive contains and == searches send no broader text-match, !contains is post-filtered, and tests cover each collation, case and accent combination, plus a functional muller/Müller test.
由索引模型根据 Issue 内容生成。
描述
Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompt(s):
strip release numbers from the ROADMAP and push it, file the caldav collation work [the collation work in icalendar-searcher added an
accent_sensitiveparameter, whichcaldavhas to follow up]
icalendar-searcher (pull request: https://github.com/pycalendar/icalendar-searcher/pull/20) gives add_property_filter() an accent_sensitive parameter beside case_sensitive, and makes contains collation-aware under Collation.UNICODE / Collation.LOCALE (ICU StringSearch, the same collator as ==). The decision and its CalDAV mapping are written down in icalendar-searcher's docs/ROADMAP.md, Phase 3.
None of the collations a CalDAV server is required to support (RFC 4791 section 7.5) can express this. i;octet is case- and accent-sensitive, i;ascii-casemap folds ASCII case only, and i;unicode-casemap (RFC 5051) folds case but not accents. None of them is accent-insensitive or locale-aware.
So whenever the client-side collation is broader than what goes on the wire, the server returns a subset and the post-filter cannot bring the lost objects back. With accent_sensitive=False, a search for SUMMARY contains "muller" is sent as a text-match and the server drops "Herr Müller".
Research first: before any of this, find out which collations the servers actually support and how they match (caldav-server-tester, overlapping the first items of https://github.com/python-caldav/caldav/issues/567). The statement that no server can do accent-insensitive or locale-aware matching is from the RFC, not from testing; if some servers do better, the items below change.
What caldav needs to do:
-
CalDAVSearcher.add_property_filter()overrides the signature and lacksaccent_sensitive; add it, and pass it on. - In
_build_search_xml_query, send notext-matchforcontains/==when the client-side match can be broader than the server's. That isaccent_sensitive=False,Collation.LOCALE, andCollation.UNICODEwhatevercase_sensitivesays (ICU ignores ignorable characters, also when case-sensitive - "kaffee" matches "Kaffee" with a soft hyphen - which neitheri;octetnori;unicode-casemapdoes). At most a bareprop-filterasserting the property is defined, as for!=, and forcepost_filter. - A negated
text-match(!contains) is the other way round: a stricter server collation returns a superset, which is harmless as long as the client post-filters. Make sure it does. -
_collation_to_caldavmapsCollation.LOCALEtoi;ascii-casemapeven whencase_sensitive=True. With the item above,LOCALEno longer reaches it for positive matches, so either drop the branch or make iti;octetwhen case-sensitive. - Bump the icalendar-searcher requirement to the release carrying
accent_sensitive. - Tests: the XML builder for each (collation, case, accent) combination, and a functional test that "muller" finds "Müller" with
accent_sensitive=False.
Related: https://github.com/python-caldav/caldav/issues/567 (probing what the servers actually do with the collations). Once that is known, the item above could send a text-match to servers that are known to do better than the RFC requires.
- 主要语言
- Python
- 星标
- 412
- 派生
- 113
- 平均合并
- 22 小时 43 分钟
- 30 天内合并 PR
- 43
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-caldav/caldav 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
python-caldav/caldav#687 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
python-caldav/caldav#782 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
python-caldav/caldav#780 ·
维护者通常 1 天内回复
-
compatibility refactoring
难度 4/5 3-5 天 新手友好度 32/100
python-caldav/caldav#778 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 18/100
python-caldav/caldav#777 ·
维护者通常 1 天内回复
查看 python-caldav/caldav 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
noontide-co/mainbranch#1211 · 1 条评论 ·
维护者通常 1 天内回复
-
[1.x Bug] run-operation --sql reports success but rolls back writes on transaction-capable adapters未关闭triage
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
bug settings ui
难度 2/5 1-3 小时 新手友好度 72/100
DewaldOosthuizen/py-tray-command-launcher#162 ·
维护者通常 1 天内回复
-
run_all sleeps after the final job despite documenting delays between jobs可能已有人在做 @Gambit-Checkmate 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100