Repository navigation
feat: [SDK-5399] attribute a session started by a notification open - #2783
Open
fadi-george wants to merge 1 commit into
Open
fadi-george wants to merge 1 commit into
fadi-george wants to merge 1 commit into
Conversation
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)18/18 touched executable lines covered (100.0% — requires ≥ 80%) |
abdulraqeeb33
approved these changes
Oct 12, 2026
abdulraqeeb33
left a comment
Contributor
There was a problem hiding this comment.
Approving.
The pending id is taken on the caller thread, kept only while entry state is still a notification click, and attached only when that focus starts a new session. An open during a session that is still valid does not carry to the next one.
Base automatically changed from
fadi/SDK-5396-android-heartbeat
to
new-session-events
October 29, 2026 00:48
…o that notification Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fadi-george
force-pushed
the
fadi/SDK-5399-android-notification-attribution
branch
from
October 30, 2026 17:02
ec22c87 to
073f304
Compare
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
One Line Summary
Send
direct_attribution_idon the session create when a notification open starts a new session.Details
Motivation
The sessions API attributes a session to the notification that started it. The notification open was only reaching the influence manager, so the create never carried it.
Scope
CreateSessionOperationcarriesdirectAttributionIdagain, and the executor passes it toCreateSessionRequest(the backend client already sendsdirect_attribution_id).InfluenceManager.onDirectInfluenceFromNotification(only called for opens from the background) forwards the notification ID toISessionService.attributeNextSessionTo.SessionService.onFocustakes the pending ID on the calling thread and keeps it only ifentryStateis stillNOTIFICATION_CLICK. It's then used only on the new-session path.onFocusfires. Entry state is read inonFocusinstead of on the serial IO lane because an unfocus can reset it before the lane runs.Testing
Unit testing
SessionServiceTests: notification open starting a new session sets the ID; open during an active session leaves the session alone and doesn't attribute the next one; a pending open followed by a normal focus is omitted.InfluenceManagerTests: direct notification influence forwards the ID to the session service.SessionOperationExecutorTests: the create request includes the direct attribution ID../gradlew testDebugUnitTest spotlessCheck detektpass.Manual testing
Not tested on a device yet.
Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code