Skip to content

Fixed bug + added delete event - #209

Merged
mattt merged 1 commit into
mattt:mainfrom
Iamlel:main
Sep 6, 2026
Merged

mattt merged 1 commit into
mattt:mainfrom
Iamlel:main

Conversation

@Iamlel

@Iamlel Iamlel commented Sep 4, 2026

Copy link
Copy Markdown
Contributor
  • added delete event functionality for calendar
  • fixed bug where many connections were created and then when claude killed them the app would stop working on claude.
  • instead connection is created before listener and it will try to reconnect unless claude is closed.

@mattt

mattt commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Hi @Iamlel. Thanks for both of these. The connection fix landed separately in #208 this morning, and it moved that code out of main.swift, so the CLI half of this no longer applies. Would you rebase onto main and trim this down to the events_delete tool? That part looks good and I'd like to take it. One tip: opening PRs from a branch rather than your fork's main makes the next one easier to update.

- added delete event functionality for calendar
- fixed bug where many connections were created and then when claude killed them the app would stop working on claude.
- instead connection is created before listener and it will try to reconnect unless claude is closed.
@Iamlel

Iamlel commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Hi @mattt
Thank you for your feedback. I removed the fix that I had, and kept the delete event.
Thank you for the suggestion to use a branch, this is my first contribution on a project, I have only really done my own projects or work with friends.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Recurring-event deletion can target unintended events, and invalid span values are not rejected.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds calendar event deletion through EventKit, including recurring-event span support.

Changes:

  • Adds the events_delete tool and deletion result.
  • Declares destructive and idempotent metadata.
  • Supports deleting one occurrence or future occurrences.
File summaries
File Review
App/Services/Calendar.swift Critical: Recurring-event identifiers can resolve to the wrong occurrence, causing unintended deletion. Moderate: Invalid span values silently default to .thisEvent. Nit: The described connection/reconnect fix is absent from the changes.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +586 to +588
// For a recurring series this returns the first occurrence,
// so `.futureEvents` on it removes the whole series.
guard let event = self.eventStore.event(withIdentifier: identifier) else {
Comment on lines +598 to +599
let span: EKSpan =
arguments["span"]?.stringValue == "futureEvents" ? .futureEvents : .thisEvent
Comment on lines +545 to +546
Tool(
name: "events_delete",
@mattt
mattt merged commit da2dc67 into mattt:main Sep 6, 2026
@mattt

mattt commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Thanks, @Iamlel. Merged, with a follow-up commit (43e61bf) that adds an optional start so a recurring event's exact occurrence is targeted, and that rejects unknown span values instead of defaulting to thisEvent.

mattt added a commit that referenced this pull request Sep 6, 2026
Every occurrence of a recurring event shares one identifier,
and event(withIdentifier:) resolves it to the first occurrence,
so thisEvent could remove the wrong one
and futureEvents could remove the whole series.
An optional start date now refetches the exact occurrence,
recurring events without one are rejected,
and an unknown span throws instead of defaulting to thisEvent.
Follow-up to #209.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants