fix: maintain uid parameter in BookingDetailsSheet URL#27872
Merged
dhairyashiil merged 3 commits intomainfrom Feb 12, 2026
Merged
fix: maintain uid parameter in BookingDetailsSheet URL#27872dhairyashiil merged 3 commits intomainfrom
dhairyashiil merged 3 commits intomainfrom
Conversation
Move the isSyncedFromUrlToStoreRef guard from the effect level to inside the Zustand subscription callback. This ensures the Store→URL subscription is always created while still preventing premature URL overwrites during URL→Store sync. Also adds an E2E test verifying the uid parameter appears in the URL after clicking a booking item in the v3 bookings view. Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
There was a problem hiding this comment.
2 issues found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/web/playwright/bookings-list.e2e.ts">
<violation number="1" location="apps/web/playwright/bookings-list.e2e.ts:773">
P1: Rule violated: **E2E Tests Best Practices**
This test mutates the `bookings-v3` feature flag without cleaning it up, violating the E2E rule to reset DB state and avoid cross-test side effects. Add a teardown (e.g., in afterEach or finally) that restores the previous flag state or deletes the created record.</violation>
<violation number="2" location="apps/web/playwright/bookings-list.e2e.ts:802">
P2: Rule violated: **E2E Tests Best Practices**
Use `expect(page).toHaveURL()` to assert the URL instead of `expect.poll`, per the E2E best practices. This ensures fast failure on unexpected redirects.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Contributor
Devin AI is addressing Cubic AI's review feedbackNew feedback has been sent to the existing Devin session. View Devin Session✅ Pushed commit |
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
dhairyashiil
approved these changes
Feb 12, 2026
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 does this PR do?
Fixes a regression where the
&uid=query parameter stopped appearing in the URL when clicking a booking in the v3 bookings view. This was introduced in commita7fd7890a7which refactored the URL sync intouseBiDirectionalSyncBetweenStoreAndUrland added anisSyncedFromUrlToStoreRefguard.Root cause: The guard
if (!isSyncedFromUrlToStoreRef.current) returnwas placed at the effect level, causing the entire effect (including thestore.subscribe()call) to be skipped on initial render when the ref isfalse. After the URL→Store effect sets the ref totrue, the Store→URL effect never re-runs because its dependencies haven't changed. Result: the Zustand subscription that pushesselectedBookingUidchanges to the URL is never created.Fix: Move the guard from the effect level to inside the subscription callback. This ensures the subscription is always created, while still preventing premature URL overwrites during URL→Store sync on page refresh.
Also adds an E2E test that enables the
bookings-v3feature flag, clicks a booking item, and asserts theuidquery parameter appears in the URL. The test properly saves and restores the feature flag state viatry/finallyto avoid cross-test side effects.Type of change
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
bookings-v3feature flag/bookings/upcoming?uid=<booking-uid>The E2E test (
bookings-list.e2e.ts, grep for "clicking a booking item adds uid param") covers this flow automatically.Human Review Checklist
if (!isSyncedFromUrlToStoreRef.current) returnnow inside the subscribe callback) is logically equivalent — it still prevents Store→URL sync before URL→Store sync completes, but no longer blocks subscription creationuseEffectdependency array does not includesetSelectedBookingUidToUrl/setActiveSegmentToUrl— this is pre-existing and unchanged, but worth notingLink to Devin run: https://app.devin.ai/sessions/e312e09588404fe08637a73cf99c9486
Requested by: @eunjae-lee