refactor: share instance ids, booking slot helpers, and guest urls - #3381
Closed
cursor[bot] wants to merge 3 commits into
Closed
refactor: share instance ids, booking slot helpers, and guest urls#3381cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
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
marked this pull request as ready for review
September 5, 2026 01:14
tyler-dane
enabled auto-merge
September 5, 2026 01:15
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. |
auto-merge was automatically disabled
September 6, 2026 01:25
Pull request was closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Behavior-preserving cleanup of recent provider and booking-reschedule merges after #3125:
syncHorizoninstead of recomputing the windowLeft 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: PASSChecks run:
test:sync:fast,test:web,test:backend:fast,type-check,lint,knip,test:a11y,test:e2eNote
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-idmint/parse powers Google and Apple instance IDs so sparse cancellations stay aligned; Apple’s writer now importsparseAppleInstanceIdfromapple-instance-idinstead of inlining it. Calendar discovery for Google and Apple both usecapabilitiesForAccessRole. Event and busy queries clamp ranges viasyncHorizonin a singleclampQueryToHorizonhelper. Apple discovery errors pass CalDAV reasons through without an extra mapper.Backend booking:
guestActionUrlsbuilds 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
PublicBookingAlertand exports sticky-step styling from the layout; thin cancel/reschedule copy-link wrappers are removed in favor ofPublicBookingCopyGuestAction.Reviewed by Cursor Bugbot for commit d7b7b20. Bugbot is set up for automated code reviews on this repo. Configure here.