Map EKEvent.notes to Event.description - #21
Closed
nashysolutions-bot wants to merge 1 commit into
Closed
nashysolutions-bot wants to merge 1 commit into
nashysolutions-bot wants to merge 1 commit into
Conversation
`Event` had no property for an event's notes, so `EKEvent.notes` was dropped on conversion. Downstream in iMCP this made notes write-only: `events_create` accepts a `notes` argument and sets it on the event, but `events_fetch` returns `Ontology.Event`, so the field could never be read back. Mirrors the existing treatment of the Reminders equivalent, where `PlanAction.init(_ reminder: EKReminder)` maps `reminder.notes` to `description`. `description` is a valid property on schema.org/Event, so the JSON-LD spelling matches. Adds two tests: one that the mapping happens and stays nil when there are no notes, and one that the value survives a JSON-LD round trip. Closes mattt#20 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mattt
pushed a commit
that referenced
this pull request
Sep 22, 2026
`Event` had no property for an event's notes, so `EKEvent.notes` was dropped on conversion. Downstream in iMCP this made notes write-only: `events_create` accepts a `notes` argument and sets it on the event, but `events_fetch` returns `Ontology.Event`, so the field could never be read back. Mirrors the existing treatment of the Reminders equivalent, where `PlanAction.init(_ reminder: EKReminder)` maps `reminder.notes` to `description`. `description` is a valid property on schema.org/Event, so the JSON-LD spelling matches. Adds two tests: one that the mapping happens and stays nil when there are no notes, and one that the value survives a JSON-LD round trip. Closes #20
Owner
|
Hi @nashysolutions. Thanks for the clear write-up and for mirroring the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #20. (Opened from the Async Digital org account; #20 was filed under my personal account,
nashysolutions.)Ontology.Eventhad no property for an event's notes, soEKEvent.noteswas dropped ininit(_ event: EKEvent). Downstream in iMCP that makes notes write-only:events_createaccepts anotesargument and sets it on the event, butevents_fetchreturnsOntology.Event, so the field can never be read back — including by the client that just wrote it.It compounds with iMCP#129: until
events_updateexists, amending an event means delete-plus-recreate, and since the notes cannot be read first, that silently discards them.The change
Mirrors the existing treatment of the Reminders equivalent, where
PlanAction.init(_ reminder: EKReminder)already mapsreminder.notestodescription:public var description: String?onEvent, positioned as inPlanActionself.description = event.notesininit(_ event: EKEvent)descriptionadded toCodingKeys, with the matchingencodeIfPresent/decodeIfPresentdescriptionis a valid property on schema.org/Event, so the JSON-LD spelling needs no special-casing.Tests
Two added to
EventTests:Event initialization preserves notes as description— the mapping happens, and staysnilwhen the event has no notes.Event round-trip serialization preserves notes— the value appears asdescriptionin the encoded JSON-LD and survives a decode.Both were checked against the unpatched type as a control: they do not merely fail, they do not compile, since
Eventhas nodescriptionmember without this change.swift test --filter EventTests→ 7/7 passing.One unrelated observation
PlaceTests' "Place initialization from MKMapItem" fails on my machine onplace.telephone == "555-6789", getting"55 5678 9". It fails identically on an unmodified checkout, and CI onmainis green, so it looks locale-sensitive rather than broken —CNPhoneNumber's formatting differs under an en_GB system locale. Untouched here; mentioning it only because any contributor outside a US locale will see a red suite locally and wonder whether they caused it.