pd4d10 / git-touch

An open-source app for GitHub, GitLab, Bitbucket, Gitea, and Gitee(码云), built with Flutter
Apache License 2.0
1.53k stars 130 forks source link

Found the issue of duplicate attribution callback invocation: #226

Closed T-10810 closed 3 years ago

T-10810 commented 3 years ago

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_

luni-moon commented 3 years ago

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.