Skip to content

Commit f9ad34f

Browse files
authored
Fix/none update resume error (#141)
* use handleInitialPreferenceState onResume to avoid calling sync in the case a none method resume app occurs
1 parent 8310c1c commit f9ad34f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
======
33

4+
## 5.1.6
5+
6+
* Fixed a bug with none update method strategy that could cause background updates upon resume of the app from background
7+
48
## 5.0.6
59

610
* Fixed a bug with version rebulds that could make some initial redirects take up to 15 seconds.

www/common.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ class IonicDeployImpl {
356356
const prefs = this._savedPreferences;
357357
// Is the current version built from a previous binary?
358358
if (prefs.currentVersionId) {
359-
if (!this.isCurrentVersion(prefs.updates[prefs.currentVersionId])) {
359+
if (!this.isCurrentVersion(prefs.updates[prefs.currentVersionId]) && !this._isRunningVersion(prefs.currentVersionId)) {
360360
console.log(
361361
`Update ${prefs.currentVersionId} was built for different binary version removing update from device` +
362362
`Update binaryVersionName: ${prefs.updates[prefs.currentVersionId].binaryVersionName}, Device binaryVersionName ${prefs.binaryVersionName}` +
@@ -696,8 +696,7 @@ class IonicDeploy implements IDeployPluginAPI {
696696

697697
async onResume() {
698698
if (this.fetchIsAvailable && this.lastPause && this.minBackgroundDuration && Date.now() - this.lastPause > this.minBackgroundDuration * 1000) {
699-
await (await this.delegate).sync();
700-
await this.reloadApp();
699+
await (await this.delegate)._handleInitialPreferenceState();
701700
}
702701
}
703702

0 commit comments

Comments
 (0)