react-native-update 10.29.0-beta.0 → 10.29.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/client.ts +44 -30
- package/src/provider.tsx +3 -3
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -394,26 +394,30 @@ export class Pushy {
|
|
|
394
394
|
this.report({ type: 'downloading' });
|
|
395
395
|
let lastError: any;
|
|
396
396
|
let errorMessages: string[] = [];
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
397
|
+
const diffUrl = await testUrls(joinUrls(paths, diff));
|
|
398
|
+
if (diffUrl) {
|
|
399
|
+
log('downloading diff');
|
|
400
|
+
try {
|
|
401
|
+
await PushyModule.downloadPatchFromPpk({
|
|
402
|
+
updateUrl: diffUrl,
|
|
403
|
+
hash,
|
|
404
|
+
originHash: currentVersion,
|
|
405
|
+
});
|
|
406
|
+
succeeded = 'diff';
|
|
407
|
+
} catch (e: any) {
|
|
408
|
+
const errorMessage = `diff error: ${e.message}`;
|
|
409
|
+
errorMessages.push(errorMessage);
|
|
410
|
+
lastError = new Error(errorMessage);
|
|
411
|
+
if (__DEV__) {
|
|
407
412
|
succeeded = 'diff';
|
|
408
|
-
}
|
|
409
|
-
const errorMessage = `diff error: ${e.message}`;
|
|
410
|
-
errorMessages.push(errorMessage);
|
|
411
|
-
lastError = new Error(errorMessage);
|
|
413
|
+
} else {
|
|
412
414
|
log(errorMessage);
|
|
413
415
|
}
|
|
414
416
|
}
|
|
417
|
+
}
|
|
418
|
+
if (!succeeded) {
|
|
415
419
|
const pdiffUrl = await testUrls(joinUrls(paths, pdiff));
|
|
416
|
-
if (
|
|
420
|
+
if (pdiffUrl) {
|
|
417
421
|
log('downloading pdiff');
|
|
418
422
|
try {
|
|
419
423
|
await PushyModule.downloadPatchFromPackage({
|
|
@@ -425,24 +429,34 @@ export class Pushy {
|
|
|
425
429
|
const errorMessage = `pdiff error: ${e.message}`;
|
|
426
430
|
errorMessages.push(errorMessage);
|
|
427
431
|
lastError = new Error(errorMessage);
|
|
428
|
-
|
|
432
|
+
if (__DEV__) {
|
|
433
|
+
succeeded = 'pdiff';
|
|
434
|
+
} else {
|
|
435
|
+
log(errorMessage);
|
|
436
|
+
}
|
|
429
437
|
}
|
|
430
438
|
}
|
|
431
439
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
440
|
+
if (!succeeded) {
|
|
441
|
+
const fullUrl = await testUrls(joinUrls(paths, full));
|
|
442
|
+
if (fullUrl) {
|
|
443
|
+
log('downloading full patch');
|
|
444
|
+
try {
|
|
445
|
+
await PushyModule.downloadFullUpdate({
|
|
446
|
+
updateUrl: fullUrl,
|
|
447
|
+
hash,
|
|
448
|
+
});
|
|
449
|
+
succeeded = 'full';
|
|
450
|
+
} catch (e: any) {
|
|
451
|
+
const errorMessage = `full patch error: ${e.message}`;
|
|
452
|
+
errorMessages.push(errorMessage);
|
|
453
|
+
lastError = new Error(errorMessage);
|
|
454
|
+
if (__DEV__) {
|
|
455
|
+
succeeded = 'full';
|
|
456
|
+
} else {
|
|
457
|
+
log(errorMessage);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
446
460
|
}
|
|
447
461
|
}
|
|
448
462
|
if (sharedState.progressHandlers[hash]) {
|
package/src/provider.tsx
CHANGED
|
@@ -256,9 +256,9 @@ export const UpdateProvider = ({
|
|
|
256
256
|
}
|
|
257
257
|
const { checkStrategy, dismissErrorAfter, autoMarkSuccess } = options;
|
|
258
258
|
if (autoMarkSuccess) {
|
|
259
|
-
setTimeout(() => {
|
|
260
|
-
|
|
261
|
-
}, 1000);
|
|
259
|
+
// setTimeout(() => {
|
|
260
|
+
markSuccess();
|
|
261
|
+
// }, 1000);
|
|
262
262
|
}
|
|
263
263
|
if (checkStrategy === 'both' || checkStrategy === 'onAppResume') {
|
|
264
264
|
stateListener.current = AppState.addEventListener(
|