Repository navigation
fix: send session start envelope immediately - #2242
Conversation
| SENTRY_API void sentry_options_set_send_session_start_update( | ||
| sentry_options_t *opts, int val); | ||
|
|
||
| /** | ||
| * Returns true if the initial session update is sent when a session starts. | ||
| */ | ||
| SENTRY_API int sentry_options_get_send_session_start_update( | ||
| const sentry_options_t *opts); | ||
|
|
There was a problem hiding this comment.
it's TBD whether we want this as an option, or just do this by default (I don't see a strong argument for not sending sessions by themselves tbqh)
There was a problem hiding this comment.
Talked with @bitsandfoxes and we agree that, since this is not breaking with any spec, we decide to change the internals as it is an implementation detail on how/when sessions get sent (and this approach is arguably more "correct").
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2242 +/- ##
==========================================
- Coverage 75.63% 75.62% -0.01%
==========================================
Files 103 103
Lines 28281 28316 +35
Branches 5199 5208 +9
==========================================
+ Hits 21389 21413 +24
- Misses 5547 5563 +16
+ Partials 1345 1340 -5 🚀 New features to boost your workflow:
|
Sends the initial session update as soon as a session starts instead of with the first event or the end of the session, so a run that never sends anything else still counts. Defaults to on for Nintendo Switch and PlayStation, where the crash report embeds the live session, and off elsewhere. Co-Authored-By: Claude Fable 5.1 <[email protected]>
On the Switch and PlayStation the option is on by default, so the concurrency, late release/environment and retry restore tests saw one more session envelope than they count. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Drops the `send_session_start_update` option: `sentry_start_session` now sends the initial update as its own envelope on every platform, so a run that never sends anything else still counts. Tests expect the extra envelope. Co-Authored-By: Claude Fable 5.1 <[email protected]>
2f5261f to
eff4883
Compare
The crash tests now crash a few milliseconds after the start update is queued. On Linux CI that request was sometimes still in flight, so the crash dump wrote it to disk as well and the next run sent it twice, or it got lost. Draining the transport first keeps the envelope count fixed. Co-Authored-By: Claude Fable 5.1 <[email protected]>
| [ | ||
| "log", | ||
| "start-session", | ||
| "flush", |
There was a problem hiding this comment.
In 616bff8 we "fix" the issue where requests in-flight are potentially duplicated to disk and sent twice; this can happen for normal events too, but the problem with Sessions (that predates this PR) is that there is no deduplication logic server-side for our sessions (since we currently have no identifier for a session).
Since Sessions are to-be-reworked anyway, I'm fine with leaving this as a gap in the current implementation (but am also open to discuss this)
send_session_start_update option|
Do you prefer to have this in |
(this simplifies a bunch of test setups, since we have a need for opt-out more often than opt-in, it makes sense having this as the default)
…_session_start # Conflicts: # CHANGELOG.md # src/sentry_backend.h
Without consent the transport drops the start update unless caching is on, which left `init` false and the whole session uncounted once the update that followed went out. The session now keeps `init` until the update can be sent, and `sentry_user_consent_give` sends it. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sends the initial session update as soon as a session starts instead of with the first event or the end of the session, so a run that never sends anything else still counts. Defaults to on for Nintendo Switch and PlayStation, where the crash report embeds the live session, and off elsewhere.
Related to https://github.com/getsentry/sentry-playstation/pull/185 and https://github.com/getsentry/sentry-switch/pull/180
Implemented in https://github.com/getsentry/sentry-switch/pull/200