A failed save still shows the event as saved #43

Open
opened 2026-10-03 19:44:39 +00:00 by jalenluorion · 0 comments
Member

What's wrong
Saving or unsaving an event updates the UI first and never undoes it if the request fails. Saves fail often right now (see "Saving an event returns 500 for a second user, a repeat save, or no google_event_id"), so users see events as saved that are not stored.

How to reproduce

  1. In DevTools, block requests to /api/events/user_saved_events.
  2. Save an event: it shows as saved.
  3. Reload: it is not saved.

Expected
If the request fails, the saved state goes back to what it was and the user sees a short error.

Where to look

  • web/src/context/EventStateContext.tsx: toggleAdded updates savedEventIds before the request, and the catch only logs.

Done when

  • On failure, savedEventIds is restored to its previous value
  • The user sees a short message (reuse whatever toast or alert pattern the app already has)
  • Works for both save and unsave
**What's wrong** Saving or unsaving an event updates the UI first and never undoes it if the request fails. Saves fail often right now (see "Saving an event returns 500 for a second user, a repeat save, or no google_event_id"), so users see events as saved that are not stored. **How to reproduce** 1. In DevTools, block requests to `/api/events/user_saved_events`. 2. Save an event: it shows as saved. 3. Reload: it is not saved. **Expected** If the request fails, the saved state goes back to what it was and the user sees a short error. **Where to look** - `web/src/context/EventStateContext.tsx`: `toggleAdded` updates `savedEventIds` before the request, and the `catch` only logs. **Done when** - [ ] On failure, `savedEventIds` is restored to its previous value - [ ] The user sees a short message (reuse whatever toast or alert pattern the app already has) - [ ] Works for both save and unsave
jalenluorion added this to the Phase 1 milestone 2026-10-03 19:44:39 +00:00
jalenluorion added this to the CMUCal project 2026-10-03 19:45:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
ScottyLabs/cal#43
No description provided.