-
Notifications
You must be signed in to change notification settings - Fork 241
Emt-2337 setAnonID API #1519
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
Emt-2337 setAnonID API #1519
Conversation
/matter review |
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.
Good implementation of setAnonID API with comprehensive test coverage. Found one potential issue with type casting that could cause runtime crashes.
// Try to set with a non-string object (NSNumber) | ||
NSNumber *nonStringValue = @123; | ||
[Branch setAnonID:(NSString *)nonStringValue]; |
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.
🐛 Bug Fix
Issue: Unsafe type casting of NSNumber to NSString will cause runtime crash when the method tries to validate the parameter type
Fix: Remove the explicit cast to let the method handle type validation naturally
Impact: Prevents potential crash and allows proper testing of type validation logic
// Try to set with a non-string object (NSNumber) | |
NSNumber *nonStringValue = @123; | |
[Branch setAnonID:(NSString *)nonStringValue]; | |
// Try to set with a non-string object (NSNumber) | |
NSNumber *nonStringValue = @123; | |
[Branch setAnonID:nonStringValue]; |
I do have one question, if the anon id is set once, it will stay set. Should we have a clear method? |
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use Matter AICommand List
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use Matter AICommand List
|
Reference
EMT - 2337 : Allow for developers to pass us their Meta anon_id
https://branch.atlassian.net/browse/EMT-2337
Type Of Change
cc @BranchMetrics/saas-sdk-devs for visibility.