fix(web): register events.update in the mutation queue #82

Merged
nalum merged 1 commit from fix/events-update-registry into main 2026-08-16 12:37:47 +00:00
Owner

Editing a non-recurring event failed with "Couldn't save this event… (can't access property "mint", a is undefined)".

Cause

mutate.events.update builds the method key events.update, but the queue registry had no entry for it (create, delete, addUser, removeUser, splitOccurrence, cancelOccurrence were all present — update was missed when event editing shipped). So registry["events.update"] was undefined:

  1. spec.call() threw a TypeError (reading .call of undefined).
  2. isNetworkError misread that TypeError as an offline drop, so instead of rethrowing it entered the queue path.
  3. That path dereferenced the missing spec.mint — the error the user saw.

Fix

  • Add the events.update registry entry: it calls through online, and offline it queues with a label and patches the cached occurrence rows in place.
  • Harden wrap() so the ${service}.${method} key is checked against MethodKey at compile time. Wrapping a mutation with no registry entry is now a build error — verified it flags exactly this case. This is what would have caught the bug before it shipped.

Verification

  • make check green (removing the entry now fails the type check at the wrap("events", "update") call).
  • Deployed locally; the served bundle carries the events.update registry spec, and editing a non-recurring event saves through the seam.

🤖 Generated with Claude Code

Editing a non-recurring event failed with **"Couldn't save this event… (can't access property "mint", a is undefined)"**. ## Cause `mutate.events.update` builds the method key `events.update`, but the queue registry had no entry for it (create, delete, addUser, removeUser, splitOccurrence, cancelOccurrence were all present — update was missed when event editing shipped). So `registry["events.update"]` was `undefined`: 1. `spec.call()` threw a `TypeError` (reading `.call` of undefined). 2. `isNetworkError` misread that `TypeError` as an offline drop, so instead of rethrowing it entered the queue path. 3. That path dereferenced the missing `spec.mint` — the error the user saw. ## Fix - Add the `events.update` registry entry: it calls through online, and offline it queues with a label and patches the cached occurrence rows in place. - Harden `wrap()` so the `${service}.${method}` key is checked against `MethodKey` at compile time. Wrapping a mutation with no registry entry is now a **build error** — verified it flags exactly this case. This is what would have caught the bug before it shipped. ## Verification - `make check` green (removing the entry now fails the type check at the `wrap("events", "update")` call). - Deployed locally; the served bundle carries the `events.update` registry spec, and editing a non-recurring event saves through the seam. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(web): register events.update in the mutation queue
Some checks failed
check / commits (pull_request) Successful in 5s
check / web (pull_request) Successful in 1m34s
check / go (pull_request) Successful in 2m39s
check / report (pull_request) Successful in 5s
android / build (pull_request) Successful in 5m11s
android / report (pull_request) Successful in 3s
check / commits (push) Successful in 5s
android / report (push) Has been cancelled
check / report (push) Has been cancelled
tag / tag (push) Has been cancelled
android / build (push) Has been cancelled
check / web (push) Has been cancelled
check / go (push) Has been cancelled
70b9c6c324
Editing a non-recurring event threw 'can't access property mint, a is
undefined' and surfaced the generic save-failed message. mutate.events.update
built the method key events.update, but the queue registry had no such entry,
so the spec was undefined: the call threw a TypeError, isNetworkError misread
it as an offline drop, and the queue path then dereferenced the missing
spec.mint. Add the events.update registry entry so the update goes through the
seam like every other mutation — online it calls through, offline it queues
with a label and an in-place occurrence sketch.

Test report

Suite Tests Result Skipped
Unit 1330 ✅ pass 1
Integration 83 ✅ pass —

Coverage: 27.7%

Updated by the check workflow · commit 70b9c6c324

<!-- ci-test-report --> ## Test report | Suite | Tests | Result | Skipped | | --- | --: | --- | --: | | Unit | 1330 | ✅ pass | 1 | | Integration | 83 | ✅ pass | — | **Coverage:** 27.7% <sub>Updated by the check workflow · commit 70b9c6c32471845281a8dbffa75c4c5d69ce2e09</sub>

Android test report

Suite Tests Result Skipped
Unit (debug) 31 ✅ pass 0

Updated by the android workflow · commit 70b9c6c324

<!-- android-test-report --> ## Android test report | Suite | Tests | Result | Skipped | | --- | --: | --- | --: | | Unit (debug) | 31 | ✅ pass | 0 | <sub>Updated by the android workflow · commit 70b9c6c32471845281a8dbffa75c4c5d69ce2e09</sub>
nalum merged commit 70b9c6c324 into main 2026-08-16 12:37:47 +00:00
nalum deleted branch fix/events-update-registry 2026-08-16 12:37:48 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
eagraiclainne/app!82
No description provided.