Pin each browser session to the deployment that served it, so a long-lived
dashboard session never 404s on a lazily-loaded chunk or changes version
mid-session. Session cookie (no expiry) → next visit gets latest.
- vite.config: inline VERCEL_DEPLOYMENT_ID + VERCEL_SKEW_PROTECTION_ENABLED.
- router.tsx (TanStack-only): set a session __vdpl cookie scoped to BASE_PATH
on client boot (platform + skew-enabled only); plus a vite:preloadError
backstop that clears the pin and reloads if a chunk 404s (e.g. the pinned
deployment aged out), with a time-window guard against reload loops.
- deployment-commit-query: fetch the version-check endpoint with
credentials:'omit' so the __vdpl cookie isn't sent and the edge serves the
LATEST deployment — the update popup keeps detecting new versions while the
session stays pinned. Stays on the basePath URL (root /api is the marketing
site in prod).
- use-check-latest-deploy: the Refresh button clears __vdpl before reloading
so it lands on latest (no-op on the Next build, which sets no cookie).
Requires enabling Skew Protection + System Env Vars in the Vercel project, and
a Maximum Age comfortably above typical session length.
* Add custom types for queries, mutations and infinite queries.
* Migrate all queries to use the new type.
* Migrate all infinite queries to useCustomInfiniteQueryOptions.
* Migrate all mutations to use useCustomMutationOptions.
* Add type to all imports in `types` folder.
* Initial work.
* Add missing import.
* Minor fixes.
* Minor fixes.
* Add a feature flag for the refresh toast.
* Add a commit for testing. Revert before merging.
* Remove header caching for testing.
* Tiny lint
* Fix
* One more
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>