Skip to content

refactor: share instance ids, graph fetch, and booking slot helpers - #3446

Merged
tyler-dane merged 4 commits into
mainfrom
cursor/code-simplification-de4a
Sep 6, 2026
Merged

refactor: share instance ids, graph fetch, and booking slot helpers#3446
tyler-dane merged 4 commits into
mainfrom
cursor/code-simplification-de4a

Conversation

@cursor

@cursor cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Supersedes #3381 (conflicting with main).

What and why

Recent provider and booking work copied the same recurring-instance suffix, access-role capability table, Microsoft Graph fetch/error shape, book-vs-reschedule slot query walks, guest alert/sticky markup, and cancel/reschedule URL pairing. This pass shares those helpers without changing behavior. Microsoft discovery still derives write/invite from canEdit rather than the shared role table, because a default calendar can be non-writable.

Verify

VERDICT: PASS

Checks run: test:sync:fast, test:web, test:backend:fast, type-check, lint, knip, test:a11y, test:e2e.

Open in Web View Automation 

Note

Medium Risk
Touches Microsoft Graph error handling and shared recurring-instance id parsing used by Google/Apple sync; refactors are intended to be behavior-preserving but regressions would affect calendar sync and guest booking flows.

Overview
This PR deduplicates repeated sync, backend, and public-booking code without changing product behavior.

Sync providers: Recurring instance id mint/parse moves into recurring-instance-id.ts, with Google and Apple re-exporting the same logic (Apple drops inline parsing from the event writer). Calendar access-role capabilities are centralized in calendar-role-capabilities.ts for Apple and Google discovery; Microsoft Graph HTTP is unified in microsoftGraphRequest and wired through calendar list, event read/write, subscriptions, and people search (plus unit tests).

Public booking: guestActionUrls pairs cancel and reschedule URLs in the public booking service. The web layer extracts PublicBookingAlert and a shared sticky-step class, drops thin copy-link wrapper components in favor of PublicBookingCopyGuestAction, and consolidates month slot queries, prefetch, and “next available day” search in public-booking.query.ts. Docs update the implementation map to match.

Reviewed by Cursor Bugbot for commit 72c89c2. Bugbot is set up for automated code reviews on this repo. Configure here.

cursoragent and others added 4 commits September 6, 2026 01:11
Google and Apple minted the same recurring-instance suffix and copied the
same access-role capability table. Move parseAppleInstanceId next to the
mint helper so the writer is not also a parser.

Co-authored-by: tyler <tyler@switchback.tech>
Calendar, event, people, and notification adapters each repeated bearer
auth, the 30s timeout, JSON parse, and the { response: { status, data } }
error shape. One helper keeps that contract in one place.

Co-authored-by: tyler <tyler@switchback.tech>
Book and reschedule duplicated month-slot query, prefetch, and next-available
walks. The guest pages also copied the same alert and sticky footer class,
and two thin wrappers only forwarded copy-link props.

Co-authored-by: tyler <tyler@switchback.tech>
The writer still annotates instance patch and delete with
ParsedAppleInstanceId after the parser moved out of the file.

Co-authored-by: tyler <tyler@switchback.tech>
@tyler-dane
tyler-dane marked this pull request as ready for review September 6, 2026 01:25
@tyler-dane tyler-dane added the agent-automerge Agent-loop finished; merge-guard may squash-merge label Sep 6, 2026
@tyler-dane
tyler-dane enabled auto-merge September 6, 2026 01:26
@tyler-dane
tyler-dane added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit 1af1857 Sep 6, 2026
33 checks passed
@tyler-dane
tyler-dane deleted the cursor/code-simplification-de4a branch September 6, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-automerge Agent-loop finished; merge-guard may squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants