Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ttfd): error when calling reportFullyDisplayed() twice #2339

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

buenaflor
Copy link
Contributor

@buenaflor buenaflor commented Oct 9, 2024

📜 Description

When completer is already finished then calling complete() on it again throws a StateError

💡 Motivation and Context

Fixes issue taken from SDK Crash Detection:

StateError: null
  #0      _AsyncCompleter.complete (dart:async/future_impl.dart:84)
  #1      TimeToFullDisplayTracker.reportFullyDisplayed (package:sentry_flutter/src/navigation/time_to_full_display_tracker.dart:80)
  #2      TimeToDisplayTracker.reportFullyDisplayed (package:sentry_flutter/src/navigation/time_to_display_tracker.dart:39)
  #3      SentryFlutter.reportFullyDisplayed (package:sentry_flutter/src/sentry_flutter.dart:245)
  #4      new Future.delayed.<fn> (dart:async/future.dart:417)
  #5      Timer._createTimer.<fn> (dart:async-patch/timer_patch.dart:18)
  #6      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398)
  #7      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429)
  #8      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184)

💚 How did you test it?

Unit test

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.

Project coverage is 90.81%. Comparing base (77b8ba7) to head (cc3a460).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
flutter/lib/src/sentry_flutter.dart 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2339      +/-   ##
==========================================
+ Coverage   86.38%   90.81%   +4.43%     
==========================================
  Files         247       73     -174     
  Lines        8615     2396    -6219     
==========================================
- Hits         7442     2176    -5266     
+ Misses       1173      220     -953     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Oct 9, 2024

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 487.74 ms 563.45 ms 75.70 ms
Size 6.49 MiB 7.56 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
8ced2dc 295.58 ms 336.49 ms 40.91 ms
559d28f 302.35 ms 339.53 ms 37.18 ms
62ae1b3 419.60 ms 494.14 ms 74.54 ms
6d7a391 331.94 ms 367.04 ms 35.10 ms
3ad66e4 406.90 ms 481.48 ms 74.58 ms
3334ac1 303.98 ms 366.65 ms 62.67 ms
0118295 365.71 ms 438.56 ms 72.85 ms
7e7f0b1 387.44 ms 459.14 ms 71.70 ms
fe4aa56 356.06 ms 428.67 ms 72.61 ms
25161f4 353.98 ms 431.94 ms 77.96 ms

App size

Revision Plain With Sentry Diff
8ced2dc 6.06 MiB 7.03 MiB 990.29 KiB
559d28f 5.94 MiB 6.92 MiB 1001.70 KiB
62ae1b3 6.35 MiB 7.40 MiB 1.05 MiB
6d7a391 5.94 MiB 6.95 MiB 1.01 MiB
3ad66e4 6.33 MiB 7.26 MiB 947.04 KiB
3334ac1 6.06 MiB 7.03 MiB 993.54 KiB
0118295 6.33 MiB 7.26 MiB 947.07 KiB
7e7f0b1 6.35 MiB 7.34 MiB 1008.33 KiB
fe4aa56 6.06 MiB 7.10 MiB 1.04 MiB
25161f4 6.27 MiB 7.20 MiB 960.44 KiB

Previous results on branch: fix/ttfd-completer

Startup times

Revision Plain With Sentry Diff
2e7d7ff 487.13 ms 535.53 ms 48.41 ms

App size

Revision Plain With Sentry Diff
2e7d7ff 6.49 MiB 7.56 MiB 1.07 MiB

Copy link
Contributor

github-actions bot commented Oct 9, 2024

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1255.50 ms 1278.49 ms 22.99 ms
Size 8.38 MiB 9.74 MiB 1.36 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
24b6e60 1250.69 ms 1268.63 ms 17.94 ms
2e1e4ae 1254.41 ms 1278.55 ms 24.14 ms
6a5a65d 1237.22 ms 1250.29 ms 13.07 ms
73d70bf 1249.08 ms 1268.41 ms 19.33 ms
7faee57 1232.65 ms 1246.10 ms 13.45 ms
43760f9 1216.07 ms 1238.51 ms 22.44 ms
6daa837 1250.42 ms 1265.60 ms 15.18 ms
d4120ac 1260.61 ms 1274.09 ms 13.47 ms
d883d62 1221.39 ms 1230.18 ms 8.80 ms
43abc4f 1248.33 ms 1272.86 ms 24.52 ms

App size

Revision Plain With Sentry Diff
24b6e60 8.32 MiB 9.38 MiB 1.06 MiB
2e1e4ae 8.34 MiB 9.65 MiB 1.31 MiB
6a5a65d 8.34 MiB 9.65 MiB 1.31 MiB
73d70bf 8.38 MiB 9.70 MiB 1.33 MiB
7faee57 8.33 MiB 9.64 MiB 1.31 MiB
43760f9 8.29 MiB 9.36 MiB 1.07 MiB
6daa837 8.33 MiB 9.40 MiB 1.07 MiB
d4120ac 8.28 MiB 9.34 MiB 1.06 MiB
d883d62 8.29 MiB 9.36 MiB 1.07 MiB
43abc4f 8.33 MiB 9.54 MiB 1.21 MiB

Previous results on branch: fix/ttfd-completer

Startup times

Revision Plain With Sentry Diff
2e7d7ff 1242.24 ms 1259.85 ms 17.61 ms

App size

Revision Plain With Sentry Diff
2e7d7ff 8.38 MiB 9.74 MiB 1.36 MiB

@buenaflor buenaflor merged commit 824c070 into main Oct 10, 2024
56 checks passed
@buenaflor buenaflor deleted the fix/ttfd-completer branch October 10, 2024 15:10
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.

2 participants