Skip to content

Improve callback handling and test visibility #4593

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

Conversation

markushi
Copy link
Member

@markushi markushi commented Aug 1, 2025

📜 Description

#skip-changelog

Just some minor nits:

  • added @testonly getters
  • Update internal state first before notifying listeners
  • Add listeners before notifying them as well

💚 How did you test it?

Added unit tests.

📝 Checklist

  • 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.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Aug 1, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 468.04 ms 498.42 ms 30.38 ms
Size 1.58 MiB 2.09 MiB 521.83 KiB

Baseline results on branch: rz/perf/single-lifecycle-observer

Startup times

Revision Plain With Sentry Diff
985e191 381.06 ms 407.08 ms 26.02 ms
8926466 426.41 ms 462.50 ms 36.09 ms
6fd675a 403.43 ms 446.55 ms 43.13 ms

App size

Revision Plain With Sentry Diff
985e191 1.58 MiB 2.09 MiB 521.14 KiB
8926466 1.58 MiB 2.09 MiB 521.82 KiB
6fd675a 1.58 MiB 2.09 MiB 521.12 KiB

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks ❤️

@romtsn romtsn merged commit da939a8 into rz/perf/single-lifecycle-observer Aug 4, 2025
36 checks passed
@romtsn romtsn deleted the markushi/perf/single-lifecycle-observer-improvements branch August 4, 2025 12:33
romtsn added a commit that referenced this pull request Aug 5, 2025
* perf(connectivity): Cache network capabilities and status to reduce IPC calls

* changelog

* Changelog

* revert

* fix(breadcrumbs): Deduplicate battery breadcrumbs

* ref

* Changelog

* Fix test

* perf(connectivity): Have only one NetworkCallback active at a time

* Changelog

* perf(integrations): Use single lifecycle observer

* Add tests

* Changelog

* Fix tests

* Improve callback handling and test visibility (#4593)

* Null-check lifecycleObserver

---------

Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>
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