Skip to content

refactor: share instance ids, booking slot helpers, and guest urls - #3381

Closed
cursor[bot] wants to merge 3 commits into
mainfrom
refactor/share-recent-helpers
Closed

refactor: share instance ids, booking slot helpers, and guest urls#3381
cursor[bot] wants to merge 3 commits into
mainfrom
refactor/share-recent-helpers

Conversation

@cursor

@cursor cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What and why

Behavior-preserving cleanup of recent provider and booking-reschedule merges after #3125:

  • Share recurring-instance id mint and parse between Google and Apple so sparse cancellations stay byte-aligned
  • Share the access-role capability table used by Google and Apple calendar discovery
  • Clamp connection event and busy queries with syncHorizon instead of recomputing the window
  • Share public booking month-slot query, prefetch, and next-available walks between book and reschedule
  • Extract the guest alert and sticky-step class; inline two thin copy-link wrappers
  • Pair cancel and reschedule guest-action URLs once in the public booking service

Left alone: WelcomeModal step machine, Block Party HUD, Google toast defer scaffolding, OAuth token helpers (transport still differs), slot-picker flow hooks (confirm vs create still diverge), and CalDAV discovery fixtures.

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

Low Risk
Refactor consolidates duplicate logic without changing contracts; the recurring-instance-id and horizon clamp paths are sensitive but intended to be byte-identical to prior behavior.

Overview
Behavior-preserving cleanup that deduplicates cross-cutting logic across sync providers, connection APIs, public booking backend, and guest UI.

Sync: New shared recurring-instance-id mint/parse powers Google and Apple instance IDs so sparse cancellations stay aligned; Apple’s writer now imports parseAppleInstanceId from apple-instance-id instead of inlining it. Calendar discovery for Google and Apple both use capabilitiesForAccessRole. Event and busy queries clamp ranges via syncHorizon in a single clampQueryToHorizon helper. Apple discovery errors pass CalDAV reasons through without an extra mapper.

Backend booking: guestActionUrls builds cancel and reschedule links once for create, patch, and reschedule.

Web booking: Month-slot queries, prefetch, and “jump to next available” share one code path for book vs reschedule flows. UI extracts PublicBookingAlert and exports sticky-step styling from the layout; thin cancel/reschedule copy-link wrappers are removed in favor of PublicBookingCopyGuestAction.

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

cursoragent and others added 3 commits September 5, 2026 01:14
Google and Apple minted the same recurring-instance suffix and copied the
same access-role capability table. Connection event and busy queries also
recomputed the horizon window instead of calling syncHorizon.

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>
Create, patch, and reschedule each built cancel and reschedule URLs with
the same two buildGuestActionUrl calls.

Co-authored-by: tyler <tyler@switchback.tech>
@tyler-dane tyler-dane added the agent-automerge Agent-loop finished; merge-guard may squash-merge label Sep 5, 2026 — with Cursor
@tyler-dane
tyler-dane marked this pull request as ready for review September 5, 2026 01:14
@tyler-dane
tyler-dane enabled auto-merge September 5, 2026 01:15
@tyler-dane

Copy link
Copy Markdown
Contributor

Superseded by #3446, which rebases these helpers onto current main and adds the Microsoft Graph fetch share. Closing this conflicting PR so merge-guard does not try both.

@tyler-dane tyler-dane closed this Sep 6, 2026
auto-merge was automatically disabled September 6, 2026 01:25

Pull request was closed

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