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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.29.0-beta.0",
3
+ "version": "10.29.0-beta.1",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {
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
- if (!__DEV__) {
398
- const diffUrl = await testUrls(joinUrls(paths, diff));
399
- if (diffUrl) {
400
- log('downloading diff');
401
- try {
402
- await PushyModule.downloadPatchFromPpk({
403
- updateUrl: diffUrl,
404
- hash,
405
- originHash: currentVersion,
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
- } catch (e: any) {
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 (!succeeded && pdiffUrl) {
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
- log(errorMessage);
432
+ if (__DEV__) {
433
+ succeeded = 'pdiff';
434
+ } else {
435
+ log(errorMessage);
436
+ }
429
437
  }
430
438
  }
431
439
  }
432
- const fullUrl = await testUrls(joinUrls(paths, full));
433
- if (!succeeded && fullUrl) {
434
- log('downloading full patch');
435
- try {
436
- await PushyModule.downloadFullUpdate({
437
- updateUrl: fullUrl,
438
- hash,
439
- });
440
- succeeded = 'full';
441
- } catch (e: any) {
442
- const errorMessage = `full patch error: ${e.message}`;
443
- errorMessages.push(errorMessage);
444
- lastError = new Error(errorMessage);
445
- log(errorMessage);
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
- markSuccess();
261
- }, 1000);
259
+ // setTimeout(() => {
260
+ markSuccess();
261
+ // }, 1000);
262
262
  }
263
263
  if (checkStrategy === 'both' || checkStrategy === 'onAppResume') {
264
264
  stateListener.current = AppState.addEventListener(