Principal.calendar_home_set and get_calendars() disagree on where calendars live without a calendar-home-set
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Read Principal.calendar_home_set in caldav/collection.py alongside BaseDAVClient._calendar_home_urls() and trace how Principal.calendar(), make_calendar(), and _async_get_calendar_home_set() use the property. Check the iCloud host-switching behavior in the setter and run the GMX-related tests to compare discovery and calendar creation paths. Done means both paths use the same fallback order and synchronous and asynchronous behavior remain consistent.
Written by the indexing model from the issue text.
Description
Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5 (Claude Code) while reviewing https://github.com/python-caldav/caldav/pull/744, from the prompts:
Look into #744
Rebase and fix issues
On a server that advertises no calendar-home-set, the two discovery paths look in different places:
client.get_calendars()/Principal.get_calendars()(BaseDAVClient._calendar_home_urls()) search the principal URL first (the GMX fallback), and since https://github.com/python-caldav/caldav/pull/744 the client URL only when the principal holds no calendars.Principal.calendar_home_set(caldav/collection.py, the setter) falls back toclient.url:URL.objectify(None)isNone, andclient.url.join(None)is the client URL.Principal.calendar(name=..., cal_id=...),Principal.make_calendar()and their async twins go through this property.
So on GMX-like servers principal.get_calendars() can list calendars that principal.calendar(cal_id=...) will not resolve against the same base, and make_calendar() creates below the client URL rather than below the principal where the calendars were found. The inconsistency predates PR 744 - the GMX fallback in get_calendars() was added without touching the property.
Possible fix: have Principal.calendar_home_set use the same fallback order as _calendar_home_urls() (principal URL, then client URL), sharing the logic rather than duplicating it. Needs care for the async lazy path (_async_get_calendar_home_set()) and the icloud host-switching side effect in the setter.
(It's needed to get tests working under GMX again to see how it behaves)
- Dominant language
- Python
- Stars
- 412
- Forks
- 113
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 34
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-caldav/caldav
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
python-caldav/caldav#687 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
python-caldav/caldav#763 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
python-caldav/caldav#761 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
python-caldav/caldav#725 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
python-caldav/caldav#720 ·
Maintainers usually reply within 1 day
All issues in python-caldav/caldav
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
spec-kitty/spec-kitty#6112 ·
Maintainers usually reply within 1 day
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter servedPossibly taken @Mrun25 claimed this today. Openbug llm translation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BerriAI/litellm#46095 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
uberdeveloper/fastbt#29 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
andrew-blake/melcloudhome#368 ·
Maintainers usually reply within 1 day
-
lane:discover
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SPARDiffData/differential-data-collection#33 ·
Maintainers usually reply within 1 day