Skip session commit on telemetry event forwarding
What does this MR do and why?
The event forwarding endpoint (/-/collect_events) authenticates through the Rails session, so each browser telemetry beacon commits the session and refreshes its TTL. Snowplow activity tracking pings this endpoint on a heartbeat while a page is active, which keeps the session alive and defeats inactivity-based session expiry.
This sets request.session_options[:skip] on the endpoint, so it still authenticates and forwards events but no longer commits or extends the session, matching the pattern already used by SearchController.
This is pre-existing behavior (any authenticated request refreshes the session); it was surfaced while verifying the session-expiry modal work. It affects instances that send telemetry same-origin to /-/collect_events (self-managed and Dedicated with product usage data enabled). GitLab.com is unaffected, since it sends telemetry to an external collector cross-origin, so no session cookie is sent.
References
Found while verifying !247910 (closed) ("Warn on SAML instances when a session expires").
Screenshots or screen recordings
Backend-only change, no UI.
How to set up and validate locally
- On a local GDK, product usage data is on by default, so pages POST to
/-/collect_events. Confirm in DevTools Network. - Set a short Session duration (Admin > Settings > General > Account and limit), for example 2 minutes, and restart GitLab.
- Sign in, open a page, and keep interacting (mouse moves, scrolls) so Snowplow page pings keep firing.
- Watch the
/-/collect_eventsresponses in DevTools:X-Gitlab-Session-Expires-Atshould stay flat across pings. Before this change it stepped forward on each ping. - Confirm the session still expires at the configured duration despite the ongoing pings (the next navigation redirects to sign-in).
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.