Skip to content

Bug 2058240: Filters from cookies don't make it into the URL - #1076

Open
kala-moz wants to merge 1 commit into
mozilla:mainfrom
kala-moz:match-cookie-filters-with-url
Open

Bug 2058240: Filters from cookies don't make it into the URL#1076
kala-moz wants to merge 1 commit into
mozilla:mainfrom
kala-moz:match-cookie-filters-with-url

Conversation

@kala-moz

@kala-moz kala-moz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Bug 2058240

Deploy Link

Filters and sort were persisted to both the URL and cookies, and read as urlParam ?? cookie per column. So opening a shared link fell back to the recipient's own cookies for any column/sort not spelled out in the URL — the same URL showed different results for different people.

Introduce an explicit "initialized" URL marker:

  • On the first load of an uninitialized URL, seed the remembered filter/sort cookies into the URL and stamp it initialized=1 (via replaceState, so no rerender or loader refetch).

  • Once initialized, filters/sort are read only from the URL — a missing param means the default, never a cookie. Cookies are still written on change so the memory survives for the next fresh visit.

Also read the live URL params when writing filter/sort changes, instead of a memoized snapshot, so an out-of-band param (the seeded marker) isn't clobbered and dropped by a later toggle.

Centralize the query-param/cookie keys and the marker helpers in tableStatePersistence.ts. Add tests covering: a fresh URL seeds from cookies and gains the marker, an initialized URL ignores cookies, and the marker survives a filter toggle.

Co-Authored-By: Claude Opus 4.8

@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for mozilla-perfcompare ready!

Name Link
🔨 Latest commit 9c498c2
🔍 Latest deploy log https://app.netlify.com/projects/mozilla-perfcompare/deploys/6a7a11034547870008e5b2c4
😎 Deploy Preview https://deploy-preview-1076--mozilla-perfcompare.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant