Skip to content

fix(web): never let the calendar be silently wrong - #2410

Merged
cursor[bot] merged 6 commits into
mainfrom
cursor/never-silent-calendar-wrong-8f44
Jul 27, 2026
Merged

fix(web): never let the calendar be silently wrong#2410
cursor[bot] merged 6 commits into
mainfrom
cursor/never-silent-calendar-wrong-8f44

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Summary

Three failure paths were silent; this wires existing query/mutation/SSE states into UI the app already knows how to show.

  • Invalid save: useSaveEventForm keeps the form open and returns fieldErrors; the event form renders them instead of discarding the draft.
  • Failed mutation: optimistic writes snapshot on mutate, restore when the failing mutation is alone in flight (toast via existing reportError), and still invalidate on settle. Concurrent writes are left alone so a newer optimistic edit is not clobbered.
  • Failed fetch: Day/Week grids surface a CalendarList-style “Couldn't load events / Retry” overlay from isError + refetch.
  • Stale after sleep: SSE open reconnect notifies onStreamReopen → invalidate events/calendars; event queries also refetchOnWindowFocus: true.

Test plan

  • bun test:web -- focused suites for save form, mutations, EventGrid, SSE connection/provider, SidebarEventDetails
  • Manual: submit an invalid timed range and confirm the form stays open with the end-time error
  • Manual: force a write failure (offline) and confirm toast + rollback of a lone edit
  • Manual: fail the events query and confirm grid Retry refetches
  • Manual: sleep/wake or drop SSE and confirm events refetch on reconnect / window focus
Open in Web Open in Cursor 

cursoragent and others added 6 commits July 27, 2026 17:01
Keep the event form open with field errors on invalid saves, roll back
lone failed optimistic mutations (with toast), show a grid retry state
on fetch errors, and refetch on SSE reopen and window focus.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Restore only the failed write key when other mutations are in flight, and
always refetch event queries on window focus despite staleTime.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Avoid series fan-out and concurrent delete surgical restores that could
clobber other optimistic writes; preserve demoEventIds on restore.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@cursor
cursor Bot marked this pull request as ready for review July 27, 2026 17:50
@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_4bc11f06-2301-450f-9610-b0916977d056)

@cursor
cursor Bot merged commit bfeadc7 into main Jul 27, 2026
19 checks passed
@cursor
cursor Bot deleted the cursor/never-silent-calendar-wrong-8f44 branch July 27, 2026 17:52
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.

2 participants