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

[MC-2359] Add normalized event and property names evaluation #385

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

nishant-clevertap
Copy link
Contributor

@nishant-clevertap nishant-clevertap commented Nov 14, 2024

  • Adds method areEqualNormalizedName: to check if two strings are normalized equal or not.
  • Adds method getNormalizedName: to get normalized name after removing white spaces and converting it to lowercase with en_US locale.
  • Added normalisation to event name and event property name.
  • Added unit tests.

@nzagorchev
Copy link
Contributor

@nishant-clevertap Implementation looks good to me. Please add a comment on why this is done and why we use the English locale, see the android PR for details.

@nishant-clevertap
Copy link
Contributor Author

@nishant-clevertap Implementation looks good to me. Please add a comment on why this is done and why we use the English locale, see the android PR for details.

Added method docs and comment.

Copy link
Contributor

@nzagorchev nzagorchev left a comment

Choose a reason for hiding this comment

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

We need to define the behavior if multiple properties equal the normalized property name, for example:

NSArray *whenTriggers = @[
    @{
        @"eventName": @"event1",
        @"eventProperties": @[
            @{
                @"propertyName": @"prop1",
                @"operator": @1,
                @"propertyValue": @"test"
            }
        ]
    }
];

match = [triggerMatcher matchEventWhenTriggers:whenTriggers eventName:@"event1" eventProperties:@{
    @"Prop  1": @"test1",
    @"Prop1": @"test",
    @"prop1": @"test2"
}];

We also need a test for the items keys normalization.

@nzagorchev nzagorchev self-assigned this Nov 27, 2024
@nzagorchev nzagorchev self-requested a review November 27, 2024 14:48
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.

3 participants