react-native-update 10.25.2 → 10.25.3

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.
@@ -49,7 +49,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
49
49
 
50
50
  private void removeDirectory(File file) throws IOException {
51
51
  if (UpdateContext.DEBUG) {
52
- Log.d("RNUpdate", "Removing " + file);
52
+ Log.d("react-native-update", "Removing " + file);
53
53
  }
54
54
  if (file.isDirectory()) {
55
55
  File[] files = file.listFiles();
@@ -88,7 +88,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
88
88
  BufferedSink sink = Okio.buffer(Okio.sink(writePath));
89
89
 
90
90
  if (UpdateContext.DEBUG) {
91
- Log.d("RNUpdate", "Downloading " + url);
91
+ Log.d("react-native-update", "Downloading " + url);
92
92
  }
93
93
 
94
94
  long bytesRead = 0;
@@ -98,7 +98,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
98
98
  received += bytesRead;
99
99
  sink.emit();
100
100
  if (UpdateContext.DEBUG) {
101
- Log.d("RNUpdate", "Progress " + received + "/" + contentLength);
101
+ Log.d("react-native-update", "Progress " + received + "/" + contentLength);
102
102
  }
103
103
 
104
104
  int percentage = (int)(received * 100.0 / contentLength + 0.5);
@@ -115,7 +115,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
115
115
  sink.close();
116
116
 
117
117
  if (UpdateContext.DEBUG) {
118
- Log.d("RNUpdate", "Download finished");
118
+ Log.d("react-native-update", "Download finished");
119
119
  }
120
120
  }
121
121
 
@@ -244,7 +244,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
244
244
 
245
245
 
246
246
  if (UpdateContext.DEBUG) {
247
- Log.d("RNUpdate", "Unzip finished");
247
+ Log.d("react-native-update", "Unzip finished");
248
248
  }
249
249
  }
250
250
 
@@ -260,7 +260,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
260
260
  File lastTarget = null;
261
261
  for (File target: targets) {
262
262
  if (UpdateContext.DEBUG) {
263
- Log.d("RNUpdate", "Copying from resource " + fn + " to " + target);
263
+ Log.d("react-native-update", "Copying from resource " + fn + " to " + target);
264
264
  }
265
265
  if (lastTarget != null) {
266
266
  copyFile(lastTarget, target);
@@ -352,7 +352,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
352
352
  copyFromResource(copyList);
353
353
 
354
354
  if (UpdateContext.DEBUG) {
355
- Log.d("RNUpdate", "Unzip finished");
355
+ Log.d("react-native-update", "Unzip finished");
356
356
  }
357
357
 
358
358
  }
@@ -418,12 +418,12 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
418
418
  throw new Error("bundle patch not found");
419
419
  }
420
420
  if (UpdateContext.DEBUG) {
421
- Log.d("RNUpdate", "Unzip finished");
421
+ Log.d("react-native-update", "Unzip finished");
422
422
  }
423
423
  }
424
424
  private void doCleanUp(DownloadTaskParams param) throws IOException {
425
425
  if (UpdateContext.DEBUG) {
426
- Log.d("RNUpdate", "Start cleaning up");
426
+ Log.d("react-native-update", "Start cleaning up");
427
427
  }
428
428
  File root = param.unzipDirectory;
429
429
  for (File sub : root.listFiles()) {
@@ -499,7 +499,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
499
499
  default:
500
500
  break;
501
501
  }
502
- Log.e("pushy", "download task failed", e);
502
+ Log.e("react-native-update", "download task failed", e);
503
503
 
504
504
  if (params[0].listener != null) {
505
505
  params[0].listener.onDownloadFailed(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.25.2",
3
+ "version": "10.25.3",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {
package/src/client.ts CHANGED
@@ -361,6 +361,7 @@ export class Pushy {
361
361
  let succeeded = '';
362
362
  this.report({ type: 'downloading' });
363
363
  let lastError: any;
364
+ let errorMessages: string[] = [];
364
365
  const diffUrl = await testUrls(joinUrls(paths, diff));
365
366
  if (diffUrl) {
366
367
  log('downloading diff');
@@ -372,11 +373,13 @@ export class Pushy {
372
373
  });
373
374
  succeeded = 'diff';
374
375
  } catch (e: any) {
375
- lastError = e;
376
+ const errorMessage = `diff error: ${e.message}`;
377
+ errorMessages.push(errorMessage);
378
+ lastError = new Error(errorMessage);
376
379
  if (__DEV__) {
377
380
  succeeded = 'diff';
378
381
  } else {
379
- log(`diff error: ${e.message}, try pdiff`);
382
+ log(errorMessage);
380
383
  }
381
384
  }
382
385
  }
@@ -390,11 +393,13 @@ export class Pushy {
390
393
  });
391
394
  succeeded = 'pdiff';
392
395
  } catch (e: any) {
393
- lastError = e;
396
+ const errorMessage = `pdiff error: ${e.message}`;
397
+ errorMessages.push(errorMessage);
398
+ lastError = new Error(errorMessage);
394
399
  if (__DEV__) {
395
400
  succeeded = 'pdiff';
396
401
  } else {
397
- log(`pdiff error: ${e.message}, try full patch`);
402
+ log(errorMessage);
398
403
  }
399
404
  }
400
405
  }
@@ -408,11 +413,13 @@ export class Pushy {
408
413
  });
409
414
  succeeded = 'full';
410
415
  } catch (e: any) {
411
- lastError = e;
416
+ const errorMessage = `full patch error: ${e.message}`;
417
+ errorMessages.push(errorMessage);
418
+ lastError = new Error(errorMessage);
412
419
  if (__DEV__) {
413
420
  succeeded = 'full';
414
421
  } else {
415
- log(`full patch error: ${e.message}`);
422
+ log(errorMessage);
416
423
  }
417
424
  }
418
425
  }
@@ -427,6 +434,7 @@ export class Pushy {
427
434
  this.report({
428
435
  type: 'errorUpdate',
429
436
  data: { newVersion: hash },
437
+ message: errorMessages.join(';'),
430
438
  });
431
439
  if (lastError) {
432
440
  throw lastError;