Files
supabase/packages
Sean Oliver 97d746b665 fix: resolve 50% session tracking discrepancy on root route (#37853)
* 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
2025-08-13 12:54:52 -07:00
..
2025-08-08 14:15:39 +07:00
2025-03-26 13:38:02 +01:00
2025-04-15 17:07:53 +02:00
2025-08-08 14:15:39 +07:00
2025-08-13 10:55:09 +10:00
2025-08-08 14:15:39 +07:00