Found the issue of duplicate attribution callback invocation: #143

Closed
opened 2025-10-31 17:06:29 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @T-10810 on GitHub (Mar 27, 2021).

Found the issue of duplicate attribution callback invocation:

- (BOOL)isEqualToAttribution:(ADJAttribution *)attribution {
    if (attribution == nil) {
        return NO;
    }
    if (![NSString adjIsEqual:self.trackerToken toString:attribution.trackerToken]) {
        return NO;
    }
    if (![NSString adjIsEqual:self.trackerName toString:attribution.trackerName]) {
        return NO;
    }
    if (![NSString adjIsEqual:self.network toString:attribution.network]) {
        return NO;
    }
    if (![NSString adjIsEqual:self.campaign toString:attribution.campaign]) {
        return NO;
    }
    if (![NSString adjIsEqual:self.adgroup toString:attribution.adgroup]) {
        return NO;
    }
    if (![NSString adjIsEqual:self.creative toString:attribution.creative]) {
        return NO;
    }
    if (![NSString adjIsEqual:self.clickLabel toString:attribution.clickLabel]) {
        return NO;
    }
    if (![NSString adjIsEqual:self.adid toString:attribution.adid]) {
        return NO;
    }
    if (![NSString adjIsEqual:self.costType toString:attribution.costType]) {
        return NO;
    }
    // costAmount is of type NSNumber
    if (![self.costAmount isEqualToNumber:attribution.costAmount]) {
        return NO;
    }
    if (![NSString adjIsEqual:self.costCurrency toString:attribution.costCurrency]) {
        return NO;
    }

    return YES;
}

This method is called whenever Adjust SDK receives new attribution data from server and compares it to previous locally stored data. The problem is in costAmount comparison: isEqualToNumber method returns false if both NSNumber objects are nil.

This was always an issue I believe, however it seems that up until 8pm UTC March 23rd, servers were returning 0 for costAmount rather than null, so comparing 0s worked properly.
Again, the issue started in all our iOS app versions at the same time which have multiple versions of Adjust SDKs.

Can you confirm my guess of servers changing costAmount from 0 to null if no cost is present for install attribution?

Originally posted by @sergiymomot in https://github.com/adjust/ios_sdk/issues/518#issuecomment-808459235

Originally created by @T-10810 on GitHub (Mar 27, 2021). Found the issue of duplicate attribution callback invocation: ``` - (BOOL)isEqualToAttribution:(ADJAttribution *)attribution { if (attribution == nil) { return NO; } if (![NSString adjIsEqual:self.trackerToken toString:attribution.trackerToken]) { return NO; } if (![NSString adjIsEqual:self.trackerName toString:attribution.trackerName]) { return NO; } if (![NSString adjIsEqual:self.network toString:attribution.network]) { return NO; } if (![NSString adjIsEqual:self.campaign toString:attribution.campaign]) { return NO; } if (![NSString adjIsEqual:self.adgroup toString:attribution.adgroup]) { return NO; } if (![NSString adjIsEqual:self.creative toString:attribution.creative]) { return NO; } if (![NSString adjIsEqual:self.clickLabel toString:attribution.clickLabel]) { return NO; } if (![NSString adjIsEqual:self.adid toString:attribution.adid]) { return NO; } if (![NSString adjIsEqual:self.costType toString:attribution.costType]) { return NO; } // costAmount is of type NSNumber if (![self.costAmount isEqualToNumber:attribution.costAmount]) { return NO; } if (![NSString adjIsEqual:self.costCurrency toString:attribution.costCurrency]) { return NO; } return YES; } ``` This method is called whenever Adjust SDK receives new attribution data from server and compares it to previous locally stored data. The problem is in costAmount comparison: `isEqualToNumber` method returns false if both NSNumber objects are `nil`. This was always an issue I believe, however it seems that up until 8pm UTC March 23rd, servers were returning 0 for costAmount rather than null, so comparing 0s worked properly. Again, the issue started in all our iOS app versions at the same time which have multiple versions of Adjust SDKs. Can you confirm my guess of servers changing costAmount from 0 to null if no cost is present for install attribution? _Originally posted by @sergiymomot in https://github.com/adjust/ios_sdk/issues/518#issuecomment-808459235_
Author
Owner

@luni-moon commented on GitHub (Mar 28, 2021):

This also does not have anything to do with this repo, You have some pretty bot-like behavior. @shreyas1599 could you please check #217 and check the linked issue this "user" made, and see if you agree that this is a bot? Thanks.

@luni-moon commented on GitHub (Mar 28, 2021): This also does not have anything to do with this repo, You have some pretty bot-like behavior. @shreyas1599 could you please check #217 and check the linked issue this "user" made, and see if you agree that this is a bot? Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/git-touch#143