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

guard device name behind sendDefaultPii #2741

Merged
merged 4 commits into from
Feb 20, 2025
Merged

Conversation

buenaflor
Copy link
Contributor

@buenaflor buenaflor commented Feb 20, 2025

📜 Description

https://api.flutter.dev/flutter/dart-io/Platform/localHostname.html

💡 Motivation and Context

Closes #2738

💚 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 Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.97%. Comparing base (f42d238) to head (78a7204).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2741   +/-   ##
=======================================
  Coverage   88.97%   88.97%           
=======================================
  Files         263      263           
  Lines        8923     8924    +1     
=======================================
+ Hits         7939     7940    +1     
  Misses        984      984           

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

Copy link
Contributor

github-actions bot commented Feb 20, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1240.27 ms 1252.10 ms 11.83 ms
Size 8.42 MiB 9.97 MiB 1.54 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
57323e5 1257.88 ms 1280.73 ms 22.86 ms
ae02632 1286.77 ms 1300.37 ms 13.60 ms
fec92cc 1237.93 ms 1259.21 ms 21.28 ms
64e4616 1242.80 ms 1270.07 ms 27.27 ms
be1723a 1253.31 ms 1267.36 ms 14.06 ms
ad69abc 1259.00 ms 1261.60 ms 2.60 ms
2261c15 1249.49 ms 1259.69 ms 10.20 ms
ba9c106 1241.76 ms 1265.15 ms 23.40 ms
acbd5d3 1232.22 ms 1256.00 ms 23.78 ms
2e93bab 1237.08 ms 1258.41 ms 21.33 ms

App size

Revision Plain With Sentry Diff
57323e5 8.42 MiB 9.91 MiB 1.49 MiB
ae02632 8.16 MiB 9.15 MiB 1020.68 KiB
fec92cc 8.33 MiB 9.54 MiB 1.22 MiB
64e4616 8.28 MiB 9.34 MiB 1.05 MiB
be1723a 8.38 MiB 9.77 MiB 1.39 MiB
ad69abc 8.10 MiB 9.08 MiB 1004.37 KiB
2261c15 8.28 MiB 9.34 MiB 1.06 MiB
ba9c106 8.32 MiB 9.38 MiB 1.06 MiB
acbd5d3 8.33 MiB 9.62 MiB 1.29 MiB
2e93bab 8.38 MiB 9.73 MiB 1.36 MiB

Previous results on branch: pii/guard-device-name

Startup times

Revision Plain With Sentry Diff
877510d 1252.16 ms 1265.06 ms 12.90 ms

App size

Revision Plain With Sentry Diff
877510d 8.42 MiB 9.97 MiB 1.54 MiB

Copy link
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 451.18 ms 504.04 ms 52.86 ms
Size 6.46 MiB 7.48 MiB 1.02 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
117d988 376.32 ms 450.85 ms 74.53 ms
4c78360 402.29 ms 462.04 ms 59.76 ms
134c9f8 301.40 ms 352.65 ms 51.26 ms
a61674e 331.35 ms 391.06 ms 59.71 ms
9f9dd52 366.75 ms 443.26 ms 76.51 ms
b2cbbc8 347.80 ms 395.31 ms 47.51 ms
ba9c106 383.10 ms 454.22 ms 71.12 ms
90a08ea 477.25 ms 534.10 ms 56.85 ms
2e1e4ae 413.34 ms 509.24 ms 95.90 ms
ea1d45d 473.08 ms 537.50 ms 64.42 ms

App size

Revision Plain With Sentry Diff
117d988 6.33 MiB 7.26 MiB 947.03 KiB
4c78360 6.33 MiB 7.27 MiB 954.08 KiB
134c9f8 5.94 MiB 6.95 MiB 1.01 MiB
a61674e 6.06 MiB 7.03 MiB 990.29 KiB
9f9dd52 6.35 MiB 7.35 MiB 1019.02 KiB
b2cbbc8 6.06 MiB 7.03 MiB 995.45 KiB
ba9c106 6.33 MiB 7.27 MiB 954.12 KiB
90a08ea 6.49 MiB 7.55 MiB 1.06 MiB
2e1e4ae 6.35 MiB 7.42 MiB 1.06 MiB
ea1d45d 6.46 MiB 7.48 MiB 1.02 MiB

@buenaflor buenaflor marked this pull request as ready for review February 20, 2025 16:42
@@ -112,7 +112,8 @@ class IoEnricherEventProcessor implements EnricherEventProcessor {
SentryDevice _getDevice(SentryDevice? device) {
final platformMemory = PlatformMemory(_options);
return (device ?? SentryDevice()).copyWith(
name: device?.name ?? Platform.localHostname,
name: device?.name ??
Copy link
Contributor Author

Choose a reason for hiding this comment

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

until now by default if we didn't get a device name from the native sdks, we defaulted to using the localHostname api

Copy link
Member

@stefanosiano stefanosiano left a comment

Choose a reason for hiding this comment

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

looks good!
the docs already says the device name is sent only with defaultPii, so we're good there, too

@buenaflor buenaflor merged commit 803f3a9 into main Feb 20, 2025
160 of 162 checks passed
@buenaflor buenaflor deleted the pii/guard-device-name branch February 20, 2025 18:11
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.

guard Platform.localHostName behind sendDefaultPii
2 participants