Repository navigation
Let people choose which calendars iMCP can see - #373
Conversation
|
Following up from #364: a stored selection that fails to decode falls back to sharing every calendar. Please decode with |
|
@mattt Updated |
|
Thanks for the quick turnaround, @oliverames. Three things left before I merge:
|
…s calendar Mattt's mattt#373 review: - CalendarSelectionStore shares every calendar when the stored value is not Data, or when it decodes with none of the known keys ({"calendars":42}). Only a missing key gets the first-run default now; a present but unusable value shares no calendars. - Update and delete resolved the occurrence through a predicate over every calendar, then required only the first event's calendar. They now check the calendar of the occurrence that is actually changed. Tests cover the unknown-key, wrong-type, missing-key and corrupt-value cases.
…s calendar Mattt's mattt#373 review: - CalendarSelectionStore shares every calendar when the stored value is not Data, or when it decodes with none of the known keys ({"calendars":42}). Only a missing key gets the first-run default now; a present but unusable value shares no calendars. - Update and delete resolved the occurrence through a predicate over every calendar, then required only the first event's calendar. They now check the calendar of the occurrence that is actually changed. Tests cover the unknown-key, wrong-type, missing-key and corrupt-value cases.
|
Thanks @mattt. Both findings are fixed. The store only shares every calendar when the key is missing now. If the value isn't Update and delete check the calendar of the occurrence that actually changes, so a detached occurrence in a deselected calendar gets refused. I ran the real-calendar pass on a signed build with these fixes too. With one calendar deselected,
|
…s calendar Mattt's mattt#373 review: - CalendarSelectionStore shares every calendar when the stored value is not Data, or when it decodes with none of the known keys ({"calendars":42}). Only a missing key gets the first-run default now; a present but unusable value shares no calendars. - Update and delete resolved the occurrence through a predicate over every calendar, then required only the first event's calendar. They now check the calendar of the occurrence that is actually changed. Tests cover the unknown-key, wrong-type, missing-key and corrupt-value cases.
bdc2506 to
7affa97
Compare
Closes #102.
Replaces #341.
What it does and why
Calendar settings now let you pick which calendars clients can see. If you have never saved a selection, every calendar stays visible, so nothing changes for existing users.
What changed
calendars_listandevents_fetchonly return the selected calendars.events_create,events_updateandevents_deleterefuse to touch an unselected calendar. That includes falling back to an unselected default calendar and moving an event into one.This is the same change as #341, cut directly from current main as three commits (model, behavior and settings UI, docs) so it merges on its own.
Review fixes
CalendarSelectionStoreshares every calendar only when the stored key is missing. A value that is notData, or that decodes with none of the known keys (such as{"calendars":42}), now fails closed and shares no calendars until it is set again. Tests cover the unknown-key, wrong-type, missing-key and corrupt-value cases.events_updateandevents_deleteresolve the occurrence that will actually change and check its calendar, not only the first event they resolved. A detached occurrence in a deselected calendar is refused.Testing
xcodebuild -scheme iMCP -configuration Debug -destination platform=macOS buildsucceeds.xcodebuild -scheme imcp-serverTests ... test: 324 tests, 1 skipped, 0 failures. That includes the tests inCalendarSelectionTests.swift format lint --strictis clean on the changed files.calendars_listleft it out,events_fetchreturned none of its events, andevents_create,events_updateandevents_deleteagainst it were refused (notShared). A create in a still-selected calendar succeeded, and the throwaway event was deleted again. That pass checked reading and the refusals; it did not re-check the Settings checkbox UI itself.Not verified