Repository navigation
feat: [SDK-5382] enqueue a session create when a new session starts - #2797
Merged
Merged
Conversation
fadi-george
added this pull request to stack #2798
October 15, 2026 23:45
Contributor
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)21/21 touched executable lines covered (100.0% — requires ≥ 80%) |
Base automatically changed from
fadi/SDK-5378-android-persistent-queue-retry
to
new-session-events
October 19, 2026 18:00
When the session uses the sessions API, enqueue a CreateSessionOperation with the start time and pinned IDs. Continuing within the session timeout sends none, and the legacy start path is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y on session create Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g every event Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fadi-george
force-pushed
the
fadi/sdk-5382
branch
from
October 19, 2026 18:24
4fdb2a2 to
36384b0
Compare
nan-li
self-requested a review
October 19, 2026 18:58
abdulraqeeb33
left a comment
Contributor
There was a problem hiding this comment.
The create path is right: one enqueue per new session, a resume sends none, and the idempotency key is a bare UUID.
The body still needs device_type as an integer. See the inline.
nan-li
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces #2780, which could not be retargeted from its old stack.
One Line Summary
When the sessions API flag is on, enqueue a
CreateSessionOperationwhen a new session starts.Details
Motivation
Part of the SDK Sessions stack (SDK-5382). New sessions need a
POST /apps/{app_id}/sessions, sent through the persistent queue added in #2794 (base of this one).Scope
SessionServiceenqueues oneCreateSessionOperationon the new-session path when the session's capturedusesSessionsApiis true. It carries the app ID, the session's local ID, the pinned OneSignal and push subscription IDs,start_time, and a new idempotency key.sessionFocusTimeout(30 s) continues the session and sends no create. Cold start still ends a persisted valid session before starting a new one.TrackSessionStartOperationis unchanged in both cases; turning off legacy reporting is SDK-5388.device_typeis renamed tosubscription_typeand sent as the subscription type string (AndroidPush,FireOSPush,HuaweiPush), like outcomes/measure.idempotency_keydrops thelocal-prefix so it is a bare UUID.direct_attribution_id(SDK-5399), session end (SDK-5390).Testing
Unit testing
Added
SessionServiceTestscases: create fields when the flag is on, a new create and idempotency key per session, no create on resume within the timeout, cold start with a persisted valid session, no create when the flag is off, and no create without a push subscription ID. Updated backend and executor tests forsubscription_typeand the UUID idempotency key.spotlessCheck,detekt,testDebugUnitTest, andassembleReleasepass locally.Manual testing
Not tested on device yet; end-to-end verification is planned in the Android Rollout & QA ticket (SDK-5405).
Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code