-
Notifications
You must be signed in to change notification settings - Fork 58
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
SDK-4010 - onUserLogin for iOS appends user string prefix to both Email and Name system user properties #367
Conversation
CleverTapSDK/CTUserInfoMigrator.m
Outdated
|
||
// Iterate through the original dictionary's keys | ||
for (NSString *key in [dictionary allKeys]) { | ||
if ([knownProfileFields containsObject:key] && [key hasPrefix:@"user"]) { |
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.
I think the first condition should be enough maybe.
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.
Done the changes
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.
Please, check the comments left.
I believe the code which maps the keys becomes redundant now (CTProfileBuilder
):
KnownField kf = [CTKnownProfileFields getKnownFieldIfPossibleForKey:key];
if (kf != UNKNOWN) {
// This will return the same key
systemFields[[CTKnownProfileFields getStorageValueForField:kf]] = value;
Please, also address the following:
- Fix
CTUserInfoMigratorTest
tests - Add a
CTUserInfoMigratorTest
test for the new migration logic - Add a
CTProfileBuilder:build:completionHandler
for profile test if possible - Add a
CTLocalDataStore:generateBaseProfile
test if possible
CleverTapSDK/CTUserInfoMigrator.m
Outdated
|
||
@implementation CTUserInfoMigrator | ||
|
||
+ (void)migrateUserInfoFileForAccountID:(NSString *)acc_id deviceID:(NSString *)device_id { | ||
+ (void)migrateUserInfoFileForAccountID:(NSString *)acc_id deviceID:(NSString *)device_id config:(CleverTapInstanceConfig *) config { |
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.
Since you pass the whole CleverTapInstanceConfig
instance, you can read the accountId
from the config, instead of passing it as another parameter.
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.
Done the changes
CleverTapSDK/CTUserInfoMigrator.h
Outdated
|
||
@interface CTUserInfoMigrator : NSObject | ||
|
||
+ (void)migrateUserInfoFileForAccountID:(NSString *)acc_id deviceID:(NSString *)device_id; | ||
+ (void)migrateUserInfoFileForAccountID:(NSString *)acc_id deviceID:(NSString *)device_id config:(CleverTapInstanceConfig *) config; |
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.
This change breaks the CTUserInfoMigratorTest
tests, please see the other comment about this method parameters and address the tests, as well.
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.
Approving with the note that we need to add more unit tests later on
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.
@kushCT add version and changelog changes here or in another branch
User
prefix getting appended to system variables