-
-
Notifications
You must be signed in to change notification settings - Fork 45
Send device identifier to PersonalID #3492
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
… (manufacturer + model).
📝 WalkthroughWalkthroughThis pull request adds device information to the configuration request body in PersonalIdPhoneFragment. A new import for Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-04-22T15:48:29.346ZApplied to files:
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| body.put("application_id", requireContext().getPackageName()); | ||
| body.put("gps_location", GeoUtils.locationToString(location)); | ||
| body.put("cc_device_id", ReportingUtils.getDeviceId()); | ||
| body.put("device", String.format("%s %s", Build.MANUFACTURER, Build.MODEL)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we null check these fields before adding ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that these values should never be null as they are initialized by the system with empty strings. But that being said, empty strings shouldn't happen with any mainstream devices but are technically possible. So we should probably at least check for that and easy enough to check for null also.
But now the question is, what do we do if one or both of these values are empty/null? Should I create a localized placeholder like "unidentifiable device"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But now the question is, what do we do if one or both of these values are empty/null? Should I create a localized placeholder like "unidentifiable device"?
I think we just should not send this value in these cases so that server has a clear indication that mobile was not able to get this detail and can code the notification messaging accordingly (by skipping the device details)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I also heard rumor that some manufacturers include their name in the MODEL field, such that we would show something like "Samsung Samsung Galaxy 8".
So I created a helper for getting a clean model string and only prepend the manufacturer if it isn't already part of the model. The helper returns null if no model info is present (I chose to ignore cases where MANUFACTURER is provided but MODEL isn't), and the Phone fragment only sends the model to the server if it's available.
0dcabec
…vailable (including manufacturer). Only sending model string to server on start_configuration when available.
https://dimagi.atlassian.net/browse/CCCT-2024
Product Description
No user visible change
Technical Summary
CCCT-2024: Added device identifier string to start_configuration call (manufacturer + model).
Feature Flag
None
Safety Assurance
Safety story
Very simple change with no user-facing effect and no real way of breaking.
Dev tested that the call still succeeds.
Automated test coverage
None
QA Plan
Start configuring a PersonalID account and verify that there is no error when pressing the button to continue after entering the phone number.