Skip to content

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Oct 8, 2025

📜 Description

  • Sometimes we were using a recycled bitmap for masking (e.g. if recorder.close() is called from a different thread after we captured the screenshot, but before masking is applied) which resulted in native crashes when initing a Canvas backed by it. This PR checks for bitmap.isRecycled and recorder being closed before doing anything with the screenshot.
  • Added ReplayExecutorService which allows us to abstract away our "safe" way of submitting runnables, but also allows us to override this behaviour in tests in case we want a test to actual fail because of the exception thrown inside runnable.

💡 Motivation and Context

Closes getsentry/sentry-react-native#5159

💚 How did you test it?

Manually + automated

📝 Checklist

  • I added GH Issue ID & Linear ID
  • 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

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

github-actions bot commented Oct 8, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 421.36 ms 469.44 ms 48.08 ms
Size 1.58 MiB 2.11 MiB 540.43 KiB

Baseline results on branch: markushi/canvas-approach

Startup times

Revision Plain With Sentry Diff
8b7fc28 390.50 ms 444.36 ms 53.86 ms
0a0b1e3 353.33 ms 370.31 ms 16.98 ms

App size

Revision Plain With Sentry Diff
8b7fc28 1.58 MiB 2.11 MiB 543.01 KiB
0a0b1e3 1.58 MiB 2.11 MiB 542.83 KiB

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.

1 participant