-
-
Notifications
You must be signed in to change notification settings - Fork 273
Safely access browser navigator.deviceMemory
#3268
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
Merged
Merged
Conversation
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3268 +/- ##
=======================================
Coverage 87.96% 87.96%
=======================================
Files 290 290
Lines 10003 10003
=======================================
Hits 8799 8799
Misses 1204 1204 ☔ View full report in Codecov by Sentry. |
Android Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e45c0e1 | 447.29 ms | 558.33 ms | 111.04 ms |
0fb3800 | 465.64 ms | 536.77 ms | 71.13 ms |
eca355d | 485.50 ms | 569.85 ms | 84.35 ms |
c26ed0a | 465.52 ms | 476.38 ms | 10.86 ms |
2cb90b9 | 479.38 ms | 552.69 ms | 73.31 ms |
81f83eb | 471.40 ms | 522.14 ms | 50.74 ms |
192b44c | 472.26 ms | 477.34 ms | 5.08 ms |
93b7728 | 475.28 ms | 489.13 ms | 13.86 ms |
ec78888 | 457.94 ms | 519.96 ms | 62.02 ms |
7cfbbd6 | 499.69 ms | 592.24 ms | 92.55 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e45c0e1 | 6.54 MiB | 7.70 MiB | 1.16 MiB |
0fb3800 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
eca355d | 6.54 MiB | 7.70 MiB | 1.16 MiB |
c26ed0a | 13.93 MiB | 14.93 MiB | 1.00 MiB |
2cb90b9 | 6.54 MiB | 7.70 MiB | 1.17 MiB |
81f83eb | 6.54 MiB | 7.69 MiB | 1.15 MiB |
192b44c | 13.93 MiB | 14.93 MiB | 1.00 MiB |
93b7728 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
ec78888 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
7cfbbd6 | 6.54 MiB | 7.70 MiB | 1.17 MiB |
iOS Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
eca355d | 1238.39 ms | 1266.98 ms | 28.59 ms |
54acf91 | 1257.65 ms | 1277.96 ms | 20.31 ms |
81f83eb | 1259.53 ms | 1273.39 ms | 13.86 ms |
c26ed0a | 1244.11 ms | 1263.85 ms | 19.75 ms |
c8596a6 | 1234.11 ms | 1241.19 ms | 7.08 ms |
dbd526b | 1244.78 ms | 1259.02 ms | 14.24 ms |
192b44c | 1269.08 ms | 1275.52 ms | 6.44 ms |
79f6b41 | 1269.33 ms | 1279.71 ms | 10.38 ms |
75284dc | 1254.81 ms | 1262.28 ms | 7.46 ms |
de377fd | 1252.28 ms | 1254.76 ms | 2.48 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
eca355d | 7.86 MiB | 9.44 MiB | 1.58 MiB |
54acf91 | 20.70 MiB | 22.46 MiB | 1.75 MiB |
81f83eb | 7.86 MiB | 9.44 MiB | 1.58 MiB |
c26ed0a | 5.53 MiB | 5.97 MiB | 453.76 KiB |
c8596a6 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
dbd526b | 7.86 MiB | 9.44 MiB | 1.58 MiB |
192b44c | 5.53 MiB | 5.96 MiB | 444.33 KiB |
79f6b41 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
75284dc | 5.53 MiB | 5.97 MiB | 453.77 KiB |
de377fd | 20.71 MiB | 22.43 MiB | 1.73 MiB |
Previous results on branch: fix/type-error-null
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
0656669 | 1257.68 ms | 1266.08 ms | 8.40 ms |
28313fd | 1235.63 ms | 1224.15 ms | -11.49 ms |
7bbbaaf | 1261.51 ms | 1260.41 ms | -1.10 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
0656669 | 5.53 MiB | 6.00 MiB | 479.95 KiB |
28313fd | 5.53 MiB | 6.00 MiB | 479.96 KiB |
7bbbaaf | 5.53 MiB | 6.00 MiB | 479.95 KiB |
@stefanosiano One more pls 🙇 |
stefanosiano
approved these changes
Sep 23, 2025
can you also add a test for it, with null memory not crashing (if relatively straightforward)? |
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.
📜 Description
Safely access browser
navigator.deviceMemory
Looks like the previous approach, where we'd name the extension the same as the original, was never calling the proper extension. Static analyser was throwing a warning, but we have ignored it.
💡 Motivation and Context
Closes #3237
💚 How did you test it?
Running sample
📝 Checklist
sendDefaultPii
is enabled🔮 Next steps