Repository navigation
Resolve iOS sandbox path before uploading session replay envelope - #1518
Merged
Merged
Conversation
tustanivsky
force-pushed
the
fix/ios-replay-sandbox-path
branch
from
August 5, 2026 11:38
c0bdf46 to
dac80cd
Compare
On iOS the session replay recorder writes the video through IFileManager, which remaps the UE virtual Saved/ path into the app sandbox. When capturing the replay for a previous run's crash, the video was read via NSData using the unmapped path, so the read failed and the replay was never uploaded. Resolve the real on-disk path with ConvertToAbsolutePathForExternalAppForRead before handing it to NSData, and include the resolved path in the failure log.
tustanivsky
force-pushed
the
fix/ios-replay-sandbox-path
branch
from
August 5, 2026 12:09
84d6f6c to
5a9ec7d
Compare
…ntry-unreal into fix/ios-replay-sandbox-path
jpnurmi
approved these changes
Aug 5, 2026
2 tasks
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.
On iOS, session replay video captured for a previous run's crash wasn't uploaded to Sentry due to its invalid sandbox path (likely a regression from #1468). On the launch following a crash the SDK logged:
The recorder writes the replay
.mp4throughIFileManager(CreateFileWriter→Move). On iOS,IFileManagertransparently remaps the UE virtualSaved/path into the app sandbox (Documents/Caches), so the file physically lands there.When building the crash envelope,
FAppleSentryReplayEnvelope::CaptureForCrashEventreads the video with[NSData dataWithContentsOfFile:]which is a native API that does not apply that sandbox remapping. It received the unmapped UE path, so the read failed and the replay was dropped. The metadata sidecar read succeeded because it goes throughFFileHelper/IFileManager, which does the remapping.Suggested Fix
Resolve the real on-disk path with
IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead()before handing it toNSData. On iOS this runs the same sandbox mapping the writer used (and falls back to the write-mapped location), and on other Apple platforms it's a no-op.Testing
Verified on device (iPhone, iOS): reproduced the crash → relaunch cycle. Before the change the video read failed with the warning above; after the change the replay video is read and uploaded.
Example replay captured on iOS.