The `sb-telemetry-data` cookie and `useTelemetryCookie` hook are fully
superseded by the `_sb_first_referrer` edge cookie (GROWTH-625) and the
in-memory first-touch store (GROWTH-656). GROWTH-656 already removed the
`useTelemetryCookie` call from `PageTelemetry` — this PR cleans up the
rest.
**Changes**
- Delete `useTelemetryCookie.tsx` hook
- Remove `clearTelemetryDataCookie` from `telemetry-utils.ts` (and its
`TELEMETRY_DATA` dep)
- Remove the `clearTelemetryDataCookie` call from `consent.tsx` (the
cookie is never written anymore, so clearing it on deny is a no-op)
- Remove `TELEMETRY_DATA` key from `LOCAL_STORAGE_KEYS`
**Testing**
Verified no remaining references to `useTelemetryCookie`,
`sb-telemetry-data`, `TELEMETRY_DATA`, or `clearTelemetryDataCookie` in
the codebase.
GROWTH-646
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Removed local telemetry data collection and cookie storage
functionality.
* Updated consent handling to remove associated telemetry cookie cleanup
operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sorted all imports in all packages, `cms`, `design-system` and
`ui-library` apps by running `pnpm format` on them.
All changes in this PR are done by the script.
* fix: resolve 50% session tracking discrepancy on root route
- Fixes race condition causing ~50% discrepancy in session tracking between client and server on root route
- Implements event queuing to capture telemetry events before PostHog initializes
- Adds session ID correlation to enable unified tracking analysis between client and server events
- Uses sendBeacon API for both pageview and pageleave events to ensure reliable capture even during navigation
- Adds production safeguards with try/catch blocks and memory caps to prevent API errors from breaking tracking
* refactor(posthog-client): reduce max pending events and improve event handling
- Decreased the maximum number of queued events from 200 to 20
- Added the use of the sendBeacon API for pending events to survive page unload
- Added comments to clarify the handling of pending properties and events during posthog initialization