Skip to content

Comments

feat: send unattributed sessions to /outcomes/measure#1648

Open
nan-li wants to merge 2 commits intomainfrom
fix/send_unattributed_sessions
Open

feat: send unattributed sessions to /outcomes/measure#1648
nan-li wants to merge 2 commits intomainfrom
fix/send_unattributed_sessions

Conversation

@nan-li
Copy link
Contributor

@nan-li nan-li commented Feb 23, 2026

WIP: Confirm with analytics team on server load, otherwise PR changes are ready.

Description

One Line Summary

Send unattributed sessions to /outcomes/measure to show unattributed session data on dashboard.

Details

Motivation

Show unattributed session data on dashboard.

When the SDK was migrated from the player model, the /players/{id}/on_focus call was split into two requests: session time via Update User and session duration outcomes via /outcomes/measure. The outcomes half was only wired up for attributed sessions, so unattributed sessions never sent to /outcomes/measure, leaving unattributed session data missing from the dashboard.

Changes:

  • Remove END_SESSION guard in OSFocusTimeProcessorFactory that prevented creating an unattributed processor for session-end events
  • Add sendSessionEndOutcomes call to OSUnattributedFocusTimeProcessor alongside sendSessionTime, matching the old player model behavior where both were always sent together

Scope

Send unattributed session data to /outcomes/measure, no change to attributed sessions or session time accumulation to update user endpoint.

Testing

Unit testing

  • Add unit tests verifying OSRequestSendSessionEndOutcomes request parameters for unattributed, attributed direct, and attributed indirect influence types

Manual testing

Tested on physical iOS 26 device

  • confirmed session counts and session time is being updated in the dashboard (previously always 0)
unattributed_session_time unattributed_session_count

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

When the SDK was migrated from the player model, the /players/{id}/on_focus call was split into two requests: session time via Update User and session duration outcomes via `/outcomes/measure`. The outcomes half was only wired up for attributed sessions, so unattributed sessions never sent to `/outcomes/measure`. However, to get unattributed session data in the dashboard, unattributed sessions needed to be sent to `/outcomes/measure` as well.

- Remove END_SESSION guard in OSFocusTimeProcessorFactory that prevented creating an unattributed processor for session-end events
- Add sendSessionEndOutcomes call to OSUnattributedFocusTimeProcessor alongside sendSessionTime, matching the old model where both were always sent together
Verify the request parameters for unattributed (notification_ids omitted,
direct: false), attributed direct (direct: true), and attributed indirect
(direct: false) influence types.
@nan-li nan-li requested a review from a team February 23, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant