Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Collation: accent-insensitive and locale-aware searches must be decided client-side

未关闭
#769 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
api, search

调研方向

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_sensitive parameter, which caldav has 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 lacks accent_sensitive; add it, and pass it on.
  • In _build_search_xml_query, send no text-match for contains / == when the client-side match can be broader than the server's. That is accent_sensitive=False, Collation.LOCALE, and Collation.UNICODE whatever case_sensitive says (ICU ignores ignorable characters, also when case-sensitive - "kaffee" matches "Ka­ffee" with a soft hyphen - which neither i;octet nor i;unicode-casemap does). At most a bare prop-filter asserting the property is defined, as for !=, and force post_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_caldav maps Collation.LOCALE to i;ascii-casemap even when case_sensitive=True. With the item above, LOCALE no longer reaches it for positive matches, so either drop the branch or make it i;octet when 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python-caldav/caldav 的其他 Issue

查看 python-caldav/caldav 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。