-
Notifications
You must be signed in to change notification settings - Fork 501
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
Disable api calls #851
base: master
Are you sure you want to change the base?
Disable api calls #851
Conversation
src/script/acquisition-sdk.ts
Outdated
@@ -58,14 +58,15 @@ export class AcquisitionStatus { | |||
} | |||
|
|||
export class AcquisitionManager { | |||
private readonly BASER_URL_PART = "appcenter.ms" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;
, and check other places.
src/test/acquisition-sdk.ts
Outdated
assert.strictEqual(acquisitionSdk.AcquisitionManager.apiCallsDisabled, false); | ||
})) | ||
|
||
acquisition.reportStatusDownload(templateCurrentPackage, ((error: Error, parameter: void): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about queryUpdateWithCurrentPackage
?
configuration = { ...configuration, serverUrl: "https://codepush.appcenter.ms" } | ||
var acquisition = new acquisitionSdk.AcquisitionManager(new mockApi.CustomResponseHttpRequester(invalidJsonResponse), configuration); | ||
|
||
acquisition.queryUpdateWithCurrentPackage(templateCurrentPackage, (error: Error, returnPackage: acquisitionSdk.RemotePackage | acquisitionSdk.NativeUpdateNotification) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about reportStatusDeploy
and reportStatusDownload
?
private _appVersion: string; | ||
private _clientUniqueId: string; | ||
private _deploymentKey: string; | ||
private _httpRequester: Http.Requester; | ||
private _ignoreAppVersion: boolean; | ||
private _serverUrl: string; | ||
private _publicPrefixUrl: string = "v0.1/public/codepush/"; | ||
|
||
private static _apiCallsDisabled: boolean = false; | ||
constructor(httpRequester: Http.Requester, configuration: Configuration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line
src/test/acquisition-sdk.ts
Outdated
}); | ||
|
||
acquisition.queryUpdateWithCurrentPackage(templateCurrentPackage, (error: Error, returnPackage: acquisitionSdk.RemotePackage | acquisitionSdk.NativeUpdateNotification) => { | ||
assert.notStrictEqual(returnPackage, null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;
assert.strictEqual(acquisitionSdk.AcquisitionManager.apiCallsDisabled, true); | ||
}); | ||
|
||
acquisition.reportStatusDeploy(templateCurrentPackage, acquisitionSdk.AcquisitionStatus.DeploymentSucceeded, "1.5.0", mockApi.validDeploymentKey, ((error: Error, parameter: void): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before calling this method apiCallsDisabled
is already true
as a result of previous method invocation. We need to refresh the context before testing this and the next method.
Description
Implemented feature for stopping api calls from being sent after unsuccessful response. This behavior is aligned with other appcenter SDKs. Disabling of api calls occurs only per session after first failed request.
Related PRs or issues
AB#107980