Skip to content

Move an event to another calendar with hey event edit --calendar - #513

Merged
robzolkos merged 3 commits into
mainfrom
fix/event-edit-move-calendar
Sep 28, 2026
Merged

robzolkos merged 3 commits into
mainfrom
fix/event-edit-move-calendar

Conversation

@robzolkos

@robzolkos robzolkos commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #512.

hey event edit <id> --calendar <id> could never move an event. --calendar was both the calendar to file the event on and the only calendar the edit looked for it on, so a move looked on the destination, where the event is not yet, and answered not_found.

A whole-event edit now looks for the event over every calendar, as an --occurrence edit already does, and --calendar is only where the event goes. Passing the day it starts still keeps the read to one day.

Two ways a move could still go wrong silently now say what happened:

  • A calendar HEY won't file on. HEY answers 404 for a calendar you don't own or share, such as your personal calendar or a subscription. That reached the reader as Form request failed (HTTP 404) with code api. It is now not_found: "HEY cannot move event N to calendar M", with a hint pointing at hey calendar list.
  • An event you can't edit, such as an invitation. HEY moves one only onto a calendar nobody else is on. Otherwise it drops the calendar from the update and answers 200 with the event where it was, which the edit reported as "Event updated". The edit now compares the calendar in HEY's answer with the one asked for and fails with forbidden when they differ.

HEY began accepting that invitee move recently (the web app's calendar menu had the same silent failure). Until that reaches every server, an invitation that can't move gets the forbidden answer rather than a false "Event updated".

--help, docs/cli.md and the skill no longer say --calendar limits the search. They describe it as the destination and say which calendars can take an event. The zone tests dropped the --calendar 9 they passed only to narrow the search, since it would now mean "move to 9".


Summary by cubic

Fixes #512 so hey event edit --calendar actually moves the event, instead of never finding it because the edit only searched the destination calendar.

Bug Fixes

  • The edit now searches every calendar for the event, stopping at the one it is on; --calendar names only where the event moves to, and passing the start day still limits the search to that day.
  • A HEY 404 on a move — a calendar it won't file on (the personal calendar, a subscription) or an event deleted since it was read — is now not_found naming both and suggesting hey calendar list.
  • When HEY leaves an uneditable event such as an invitation where it was, or answers a move without naming the calendar, the event is read back around both the day it starts and the day it was asked to start to confirm where it is; a refusal is forbidden instead of falsely reporting "Event updated", and a read-back failure keeps its own error code.
  • --help, docs/cli.md, and the skill now describe --calendar as the destination and the calendars that can take an event; tests no longer pass --calendar just to narrow the search.

Written for commit 55a0b2a. Summary will update on new commits.

Review in cubic

--calendar on a whole-event edit meant two things: the calendar to file
the event on, and the only calendar to look for it on. A move looked for
the event on its destination, where it is not yet, so it always answered
not found (#512). The event is now looked for over every calendar, as an
--occurrence edit already does, and --calendar is only where it goes.

A move HEY will not make now says so. HEY files only on a calendar you own
or share and answers 404 for any other, which reached the reader as a bare
"Form request failed (HTTP 404)"; that is now named as the calendar. And an
event you cannot edit, such as an invitation, moves only onto a calendar
nobody else is on: HEY otherwise drops the calendar from the update and
answers with the event where it was, which the edit reported as updated.
The calendar HEY answers with is now checked against the one asked for.
@robzolkos
robzolkos requested a review from a team as a code owner September 28, 2026 02:15
Copilot AI balanced review requested due to automatic review settings September 28, 2026 02:15

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.

Copilot review overview

🟡 Changes recommended

Move verification can still report unconfirmed success, and update-time 404s are attributed ambiguously.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Fixes event moves by separating event discovery from the destination calendar.

Changes:

  • Searches all calendars before editing.
  • Detects rejected or silently ignored moves.
  • Updates tests, CLI help, documentation, and agent guidance.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
internal/​cmd/​events.go Implements move lookup, validation, and errors.
internal/​cmd/​events_test.go Tests successful and rejected moves.
internal/​cmd/​events_zone_test.go Updates zone tests for new calendar semantics.
docs/​cli.md Documents event moves.
skills/​hey/​SKILL.md Updates agent-facing guidance.

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

Comment thread internal/cmd/events.go Outdated
Comment thread internal/cmd/events.go Outdated
An older HEY redirects after an update, and the SDK then hands back only
the event's id, so a move went unconfirmed and was reported as updated. The
event is now read again on the day it starts to see which calendar it is on.

A 404 on a move can be the calendar or an event deleted since it was read,
and nothing in the answer says which, so the refusal names both instead of
blaming the calendar.
When HEY answers a move with the event's id alone, the event was read back
on the requested start date as one UTC day. An event keeps its own zone's
date, so a morning in Tokyo or an evening in Los Angeles sat on the
neighbouring UTC day and was missed, as was an event whose date change HEY
kept from happening. The read-back now spans the day it started on and the
day it was asked to start on, a day wide either side.

A read-back that failed after the write went through was always reported as
an API error. It keeps its own code now, so an expired sign-in or a rate
limit still exits as one.

The event is looked for calendar by calendar and the search stops at the one
it is on. Reading every calendar meant one that could not be read, listed
after the event's, stood in the way of the edit.

A refused move says what HEY still saved: an invitee's circle, countdown and
reminders go through without the calendar. The help and docs say an event on
a subscription does not move at all.
@robzolkos
robzolkos requested a balanced review from Copilot and removed request for a team September 28, 2026 10:09

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.

Copilot review overview

🟢 Approved

The implementation addresses the reported failure with documentation and comprehensive coverage of success and refusal paths.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@robzolkos
robzolkos merged commit 5187175 into main Sep 28, 2026
26 checks passed
@robzolkos
robzolkos deleted the fix/event-edit-move-calendar branch September 28, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

event edit: --calendar can't move an event to another calendar (event searched on the destination)

2 participants