Skip to content

Conversation

@mbruin-NR
Copy link
Contributor

Session replay uploads were sometimes unable to finish when the app transitioned to background. The harvest process would trigger uploads, but iOS would suspend the app before the asynchronous URLSession upload tasks could complete, resulting in lost session replay data.

Root Cause

  • Session replay data is uploaded asynchronously via URLSession.uploadTask
  • The main background task in NewRelicAgentInternal.m ends immediately after calling harvest
  • iOS suspends the app before network uploads finish, causing data loss

Solution

Implemented background task management directly in SessionReplayReporter to extend app execution time until all uploads complete.

@mbruin-NR mbruin-NR merged commit 3c40a9d into develop Nov 13, 2025
13 checks passed
@mbruin-NR mbruin-NR deleted the NR-485011 branch November 13, 2025 14:38
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.

3 participants