Skip to content

Conversation

@philipphofmann
Copy link
Member

📜 Description

The SDK reported false frame delay statistics when it moved from the background to the foreground, which also led to falsely reported app hangs.

After merging this PR, I'm going to open up the same PR to v8 and release a hotfix.

💡 Motivation and Context

Fixes GH-6345

💚 How did you test it?

I failed to reproduce the exact problem the user described in GH-6345, and so did the user. I noticed that the SDK calculated wrong frame delay numbers when moving from the background to the foreground, so I added unit tests for these scenarios.

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

The SDK reported false frame delay statistics when it moved from the
background to the foreground, which also led to falsely reported app
hangs.

Fixes GH-6345
@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.764%. Comparing base (d72784d) to head (9ed9c46).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #6381       +/-   ##
=============================================
+ Coverage   86.744%   86.764%   +0.020%     
=============================================
  Files          439       439               
  Lines        37238     37242        +4     
  Branches     17368     17365        -3     
=============================================
+ Hits         32302     32313       +11     
+ Misses        4891      4886        -5     
+ Partials        45        43        -2     
Files with missing lines Coverage Δ
Sources/Sentry/SentryDelayedFramesTracker.m 96.527% <100.000%> (+0.099%) ⬆️
Sources/Sentry/SentryFramesTracker.m 100.000% <100.000%> (ø)

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d72784d...9ed9c46. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1206.02 ms 1239.04 ms 33.02 ms
Size 23.75 KiB 987.93 KiB 964.19 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
a4c5ddc 1239.61 ms 1266.41 ms 26.80 ms
08fc5f9 1237.84 ms 1270.06 ms 32.23 ms
f5666e7 1227.08 ms 1260.18 ms 33.10 ms
7908e84 1224.33 ms 1246.39 ms 22.06 ms
d3f650a 1225.45 ms 1241.86 ms 16.41 ms
c122943 1210.94 ms 1233.78 ms 22.84 ms
cc7f629 1226.00 ms 1245.51 ms 19.51 ms
d66f082 1227.08 ms 1247.04 ms 19.96 ms
04ff3ec 1220.71 ms 1253.86 ms 33.15 ms
7b3399c 1193.35 ms 1227.38 ms 34.03 ms

App size

Revision Plain With Sentry Diff
a4c5ddc 23.75 KiB 977.30 KiB 953.55 KiB
08fc5f9 23.75 KiB 995.43 KiB 971.68 KiB
f5666e7 23.75 KiB 963.18 KiB 939.43 KiB
7908e84 23.74 KiB 872.75 KiB 849.00 KiB
d3f650a 23.75 KiB 902.48 KiB 878.73 KiB
c122943 23.74 KiB 926.65 KiB 902.90 KiB
cc7f629 23.75 KiB 878.48 KiB 854.73 KiB
d66f082 23.75 KiB 928.85 KiB 905.10 KiB
04ff3ec 23.75 KiB 880.26 KiB 856.52 KiB
7b3399c 23.75 KiB 946.68 KiB 922.94 KiB

Previous results on branch: fix/frames-delay-from-background

Startup times

Revision Plain With Sentry Diff
c228d62 1227.12 ms 1267.90 ms 40.78 ms
780d634 1225.86 ms 1256.44 ms 30.58 ms
bce284a 1219.55 ms 1259.43 ms 39.88 ms

App size

Revision Plain With Sentry Diff
c228d62 23.74 KiB 987.03 KiB 963.29 KiB
780d634 23.74 KiB 986.69 KiB 962.94 KiB
bce284a 23.75 KiB 987.97 KiB 964.23 KiB

@philipphofmann philipphofmann marked this pull request as ready for review October 8, 2025 05:20
@philipphofmann philipphofmann self-assigned this Oct 8, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@philipphofmann philipphofmann merged commit b358363 into main Oct 10, 2025
224 of 231 checks passed
@philipphofmann philipphofmann deleted the fix/frames-delay-from-background branch October 10, 2025 03:49
philipphofmann added a commit that referenced this pull request Oct 10, 2025
The SDK reported false frame delay statistics when it moved from the
background to the foreground, which also led to falsely reported app
hangs.

Fixes GH-6345
philipphofmann added a commit that referenced this pull request Oct 10, 2025
The SDK reported false frame delay statistics when it moved from the
background to the foreground, which also led to falsely reported app
hangs.

Fixes GH-6345
philipphofmann added a commit that referenced this pull request Oct 10, 2025
The SDK reported false frame delay statistics when it moved from the
background to the foreground, which also led to falsely reported app
hangs.

Fixes GH-6345
philprime added a commit that referenced this pull request Nov 5, 2025
- Remove #5591 (minimum OS version warnings) - not related to session replay
- Remove #6019 (SCNetworkReachability) - not related to session replay
- Remove #6377 (thread event issue) - not related to session replay
- Remove #6381 (frame delay) - duplicate/not related to session replay
- Keep only session replay masking related changes
philprime added a commit that referenced this pull request Nov 6, 2025
…in (#6678)

* fix(session-replay): Update rendering method for fast view rendering (#6360)
* fix(session-replay): Extend masking and focus masking on sensitive information (#6292)
* test(session-replay): Add masking tests for common cases (#6567)
* test(session-replay): Add masking tests for React Native views (#6568)
* fix(session-replay): Fix conversion of frame rate to time interval (#6623)
* test(session-replay): Add masking tests for edge cases (#6569)
* test(session-replay): Add masking tests for UIKit views (#6570)
* test(session-replay): Add masking tests for special views (#6571)
* fix(session-replay): Include layer background color when checking if a view is opaque (#6629)
* chore(tests): Remove snapshot testing to reduce repository size (#6631)
* chore: Remove unwanted CHANGELOG entries from cherry-pick
- Remove #5591 (minimum OS version warnings) - not related to session replay
- Remove #6019 (SCNetworkReachability) - not related to session replay
- Remove #6377 (thread event issue) - not related to session replay
- Remove #6381 (frame delay) - duplicate/not related to session replay
- Keep only session replay masking related changes
* docs: Move changelog changes from v8.57.1 to unreleased
* test: Resolve wrong assertions involed due to merge-conflict
* chore: Update sdk_api_V9.json
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.

App hangs v2 report very high (and invalid) durations

3 participants