From bea2b9c1782eecd29a8c08160f9477b69574655b Mon Sep 17 00:00:00 2001 From: Geoffrey Goh Date: Tue, 26 Jan 2016 18:01:44 -0800 Subject: [PATCH] from -> previous --- CodePush.js | 12 +++++------ CodePush.m | 20 +++++++++---------- .../microsoft/codepush/react/CodePush.java | 20 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/CodePush.js b/CodePush.js index cfe8f3d..b95296a 100644 --- a/CodePush.js +++ b/CodePush.js @@ -103,9 +103,9 @@ function getPromisifiedSdk(requestFetchAdapter, config) { }); }; - sdk.reportStatusDeploy = (deployedPackage, status, fromLabelOrAppVersion, fromDeploymentKey) => { + sdk.reportStatusDeploy = (deployedPackage, status, previousLabelOrAppVersion, previousDeploymentKey) => { return new Promise((resolve, reject) => { - module.exports.AcquisitionSdk.prototype.reportStatusDeploy.call(sdk, deployedPackage, status, fromLabelOrAppVersion, fromDeploymentKey, (err) => { + module.exports.AcquisitionSdk.prototype.reportStatusDeploy.call(sdk, deployedPackage, status, previousLabelOrAppVersion, previousDeploymentKey, (err) => { if (err) { reject(err); } else { @@ -140,15 +140,15 @@ async function notifyApplicationReady() { const statusReport = await NativeCodePush.getNewStatusReport(); if (statusReport) { const config = await getConfiguration(); - const fromLabelOrAppVersion = statusReport.fromLabelOrAppVersion; - const fromDeploymentKey = statusReport.fromDeploymentKey || config.deploymentKey; + const previousLabelOrAppVersion = statusReport.previousLabelOrAppVersion; + const previousDeploymentKey = statusReport.previousDeploymentKey || config.deploymentKey; if (statusReport.appVersion) { const sdk = getPromisifiedSdk(requestFetchAdapter, config); - sdk.reportStatusDeploy(/* deployedPackage */ null, /* status */ null, fromLabelOrAppVersion, fromDeploymentKey); + sdk.reportStatusDeploy(/* deployedPackage */ null, /* status */ null, previousLabelOrAppVersion, previousDeploymentKey); } else { config.deploymentKey = statusReport.package.deploymentKey; const sdk = getPromisifiedSdk(requestFetchAdapter, config); - sdk.reportStatusDeploy(statusReport.package, statusReport.status, fromLabelOrAppVersion, fromDeploymentKey); + sdk.reportStatusDeploy(statusReport.package, statusReport.status, previousLabelOrAppVersion, previousDeploymentKey); } } } diff --git a/CodePush.m b/CodePush.m index 1dd6d5f..8302357 100644 --- a/CodePush.m +++ b/CodePush.m @@ -586,20 +586,20 @@ RCT_EXPORT_METHOD(getNewStatusReport:(RCTPromiseResolveBlock)resolve } else if (![previousStatusReportIdentifier isEqualToString:currentPackageIdentifier]) { [self recordDeploymentStatusReported:currentPackageIdentifier]; if ([self isStatusReportIdentifierCodePushLabel:previousStatusReportIdentifier]) { - NSString *fromDeploymentKey = [self getDeploymentKeyFromStatusReportIdentifier:previousStatusReportIdentifier]; - NSString *fromLabel = [self getVersionLabelFromStatusReportIdentifier:previousStatusReportIdentifier]; + NSString *previousDeploymentKey = [self getDeploymentKeyFromStatusReportIdentifier:previousStatusReportIdentifier]; + NSString *previousLabel = [self getVersionLabelFromStatusReportIdentifier:previousStatusReportIdentifier]; resolve(@{ @"package": currentPackage, @"status": DeploymentSucceeded, - @"fromDeploymentKey": fromDeploymentKey, - @"fromLabelOrAppVersion": fromLabel + @"previousDeploymentKey": previousDeploymentKey, + @"previousLabelOrAppVersion": previousLabel }); } else { // Previous status report was with a binary app version. resolve(@{ @"package": currentPackage, @"status": DeploymentSucceeded, - @"fromLabelOrAppVersion": previousStatusReportIdentifier + @"previousLabelOrAppVersion": previousStatusReportIdentifier }); } return; @@ -617,18 +617,18 @@ RCT_EXPORT_METHOD(getNewStatusReport:(RCTPromiseResolveBlock)resolve } else if (![previousStatusReportIdentifier isEqualToString:appVersion]) { [self recordDeploymentStatusReported:appVersion]; if ([self isStatusReportIdentifierCodePushLabel:previousStatusReportIdentifier]) { - NSString *fromDeploymentKey = [self getDeploymentKeyFromStatusReportIdentifier:previousStatusReportIdentifier]; - NSString *fromLabel = [self getVersionLabelFromStatusReportIdentifier:previousStatusReportIdentifier]; + NSString *previousDeploymentKey = [self getDeploymentKeyFromStatusReportIdentifier:previousStatusReportIdentifier]; + NSString *previousLabel = [self getVersionLabelFromStatusReportIdentifier:previousStatusReportIdentifier]; resolve(@{ @"appVersion": appVersion, - @"fromDeploymentKey": fromDeploymentKey, - @"fromLabelOrAppVersion": fromLabel + @"previousDeploymentKey": previousDeploymentKey, + @"previousLabelOrAppVersion": previousLabel }); } else { // Previous status report was with a binary app version. resolve(@{ @"appVersion": appVersion, - @"fromLabelOrAppVersion": previousStatusReportIdentifier + @"previousLabelOrAppVersion": previousStatusReportIdentifier }); } return; diff --git a/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java b/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java index a7ee3b0..7405adb 100644 --- a/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +++ b/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java @@ -512,20 +512,20 @@ public class CodePush { } else if (!previousStatusReportIdentifier.equals(currentPackageIdentifier)) { recordDeploymentStatusReported(currentPackageIdentifier); if (isStatusReportIdentifierCodePushLabel(previousStatusReportIdentifier)) { - String fromDeploymentKey = getDeploymentKeyFromStatusReportIdentifier(previousStatusReportIdentifier); - String fromLabel = getVersionLabelFromStatusReportIdentifier(previousStatusReportIdentifier); + String previousDeploymentKey = getDeploymentKeyFromStatusReportIdentifier(previousStatusReportIdentifier); + String previousLabel = getVersionLabelFromStatusReportIdentifier(previousStatusReportIdentifier); WritableNativeMap reportMap = new WritableNativeMap(); reportMap.putMap("package", currentPackage); reportMap.putString("status", DEPLOYMENT_SUCCEEDED_STATUS); - reportMap.putString("fromDeploymentKey", fromDeploymentKey); - reportMap.putString("fromLabelOrAppVersion", fromLabel); + reportMap.putString("previousDeploymentKey", previousDeploymentKey); + reportMap.putString("previousLabelOrAppVersion", previousLabel); promise.resolve(reportMap); } else { // Previous status report was with a binary app version. WritableNativeMap reportMap = new WritableNativeMap(); reportMap.putMap("package", currentPackage); reportMap.putString("status", DEPLOYMENT_SUCCEEDED_STATUS); - reportMap.putString("fromLabelOrAppVersion", previousStatusReportIdentifier); + reportMap.putString("previousLabelOrAppVersion", previousStatusReportIdentifier); promise.resolve(reportMap); } return; @@ -544,18 +544,18 @@ public class CodePush { } else if (!previousStatusReportIdentifier.equals(appVersion)) { recordDeploymentStatusReported(appVersion); if (isStatusReportIdentifierCodePushLabel(previousStatusReportIdentifier)) { - String fromDeploymentKey = getDeploymentKeyFromStatusReportIdentifier(previousStatusReportIdentifier); - String fromLabel = getVersionLabelFromStatusReportIdentifier(previousStatusReportIdentifier); + String previousDeploymentKey = getDeploymentKeyFromStatusReportIdentifier(previousStatusReportIdentifier); + String previousLabel = getVersionLabelFromStatusReportIdentifier(previousStatusReportIdentifier); WritableNativeMap reportMap = new WritableNativeMap(); reportMap.putString("appVersion", appVersion); - reportMap.putString("fromDeploymentKey", fromDeploymentKey); - reportMap.putString("fromLabelOrAppVersion", fromLabel); + reportMap.putString("previousDeploymentKey", previousDeploymentKey); + reportMap.putString("previousLabelOrAppVersion", previousLabel); promise.resolve(reportMap); } else { // Previous status report was with a binary app version. WritableNativeMap reportMap = new WritableNativeMap(); reportMap.putString("appVersion", appVersion); - reportMap.putString("fromLabelOrAppVersion", previousStatusReportIdentifier); + reportMap.putString("previousLabelOrAppVersion", previousStatusReportIdentifier); promise.resolve(reportMap); } return;