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

fix: forward original event names to UI for kits with mapped events #301

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

mmustafa-tse
Copy link
Contributor

Summary

  • When a kit have custom mappings (such as AppsFlyer and GA4 firebase) we currently forward the mapped event name to the UI in livestream and event forwarding view where only the outbound is increased while the inbound is 0, while for the original event the inbound is increased and the output will not. This fix will forward the reporting issue by only forwarding the reporting of the original event in the outbound and will not create a new event to the schema and only increase the outbound.

Testing Plan

  • [Y] Was this tested locally? If not, explain why.
  • partial-E2E testing with breakpoints in the AppsFlyer kit to see if the mapped event forwarded as expected as well as full E2E testing on the UI to see if the original event is reported as is.
  • Unit testing cases added to check if projectedEvents are not nil and the originalEventCopy variable in kitFiler have the original event name.

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

@einsteinx2 einsteinx2 self-requested a review October 17, 2024 16:57

if (eventProjection.projectedName) {
projectionDictionary[kMPFRProjectionName] = eventProjection.projectedName;
if (eventProjection.projectedName == currentProjectionName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In Objective-C, you can't use == to compare objects (including strings). The == will just compare if the pointers are equal, there's no operator overloading. So you need to compare using isEqual:

Suggested change
if (eventProjection.projectedName == currentProjectionName) {
if ([eventProjection.projectedName isEqual:currentProjectionName]) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

jus added this change

@@ -112,19 +112,22 @@ - (instancetype)initWithMessageType:(MPMessageType)messageType execStatus:(MPKit
if (kitFilter.appliedProjections.count > 0) {
NSMutableArray *projections = [[NSMutableArray alloc] initWithCapacity:kitFilter.appliedProjections.count];
NSMutableDictionary *projectionDictionary;
NSString *currentProjectionName = ((MPEvent *)kitFilter.originalEvent).name;
Copy link
Contributor

Choose a reason for hiding this comment

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

You should check that originalEvent is an MPEvent before casting it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added as well

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.

2 participants