Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit ca54741

Browse files
committed
Merge pull request #342 from Microsoft/fix-rollback-status-report
Fix rollback status report
2 parents 9ccc651 + 66a3607 commit ca54741

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

android/app/src/main/java/com/microsoft/codepush/react/CodePushTelemetryManager.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,13 @@ public WritableMap getUpdateReport(WritableMap currentPackage) {
113113
}
114114

115115
public void recordStatusReported(ReadableMap statusReport) {
116-
if (statusReport.hasKey(APP_VERSION_KEY)) {
117-
saveStatusReportedForIdentifier(statusReport.getString(APP_VERSION_KEY));
118-
} else if (statusReport.hasKey(PACKAGE_KEY)) {
119-
String packageIdentifier = getPackageStatusReportIdentifier(statusReport.getMap(PACKAGE_KEY));
120-
saveStatusReportedForIdentifier(packageIdentifier);
116+
if (statusReport.hasKey(STATUS_KEY) && DEPLOYMENT_SUCCEEDED_STATUS.equals(statusReport.getString(STATUS_KEY))) {
117+
if (statusReport.hasKey(APP_VERSION_KEY)) {
118+
saveStatusReportedForIdentifier(statusReport.getString(APP_VERSION_KEY));
119+
} else if (statusReport.hasKey(PACKAGE_KEY)) {
120+
String packageIdentifier = getPackageStatusReportIdentifier(statusReport.getMap(PACKAGE_KEY));
121+
saveStatusReportedForIdentifier(packageIdentifier);
122+
}
121123
}
122124
}
123125

ios/CodePush/CodePushTelemetryManager.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ + (NSDictionary *)getUpdateReport:(NSDictionary *)currentPackage
101101

102102
+ (void)recordStatusReported:(NSDictionary *)statusReport
103103
{
104-
if (statusReport[AppVersionKey]) {
105-
[self saveStatusReportedForIdentifier:statusReport[AppVersionKey]];
106-
} else if (statusReport[PackageKey]) {
107-
NSString *packageIdentifier = [self getPackageStatusReportIdentifier:statusReport[PackageKey]];
108-
[self saveStatusReportedForIdentifier:packageIdentifier];
104+
if ([DeploymentSucceeded isEqualToString:statusReport[StatusKey]]) {
105+
if (statusReport[AppVersionKey]) {
106+
[self saveStatusReportedForIdentifier:statusReport[AppVersionKey]];
107+
} else if (statusReport[PackageKey]) {
108+
NSString *packageIdentifier = [self getPackageStatusReportIdentifier:statusReport[PackageKey]];
109+
[self saveStatusReportedForIdentifier:packageIdentifier];
110+
}
109111
}
110112
}
111113

0 commit comments

Comments
 (0)