Skip to content

new-list picks the wrong source when two sources share the same title #111

Description

@1nto5

On my machine reminders new-list cannot create a list at all, because EventKit
exposes two sources titled "iCloud" and only one of them holds reminders.

$ reminders new-list "test"
Multiple sources were found, please specify one with --source:
  Other
  iCloud
  Subscribed Calendars

$ reminders new-list "test" --source iCloud
Failed create new list with error: Error Domain=EKErrorDomain Code=24
"That account does not support reminders."

Enumerating EKEventStore().sources explains it:

0  Subscribed Calendars   reminder lists: 0
1  iCloud                 reminder lists: 0    id=<uuid-a>
2  Other                  reminder lists: 0
3  iCloud                 reminder lists: 13   id=<uuid-b>

All my reminder lists live in source 3. Source 1 is the iCloud calendar account,
which does not support reminders. Reminders.app shows a single "iCloud" account,
so nothing in the UI suggests there are two.

newList matches sources by title and takes the first hit:

guard let requestedSource = sources.first(where: { $0.title == requestedSourceName })

Here that is source 1, so the save fails with EKError 24. Without --source, the
unique title count is 3, so the command asks me to pick one — and no answer works,
since both candidates named "iCloud" collapse into the same string.

Creating the same list through AppleScript against the Reminders app works, so the
account itself is fine.

A possible fix would be to consider only sources that can hold reminders — for
example those with a non-empty calendars(for: .reminder) — both when matching
--source and when counting unique titles. With that filter my setup has exactly
one candidate, and the command would work without --source at all.

Environment: reminders-cli 2.5.1 (Homebrew), macOS 26.6.2, Apple silicon.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions