react-native-update 10.37.4 → 10.37.5

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.
@@ -86,7 +86,7 @@ export class PushyTurboModule extends TurboModule {
86
86
  return UpdateModuleImpl.getLocalHashInfo(this.context, hash);
87
87
  }
88
88
 
89
- async setUuid(uuid: string): Promise<boolean> {
89
+ async setUuid(uuid: string): Promise<void> {
90
90
  logger.debug(TAG, ',call setUuid');
91
91
  return UpdateModuleImpl.setUuid(this.context, uuid);
92
92
  }
@@ -131,15 +131,6 @@ export class PushyTurboModule extends TurboModule {
131
131
  return UpdateModuleImpl.downloadFullUpdate(this.context, options);
132
132
  }
133
133
 
134
- async downloadAndInstallApk(options: {
135
- url: string;
136
- target: string;
137
- hash: string;
138
- }): Promise<void> {
139
- logger.debug(TAG, ',call downloadAndInstallApk');
140
- return UpdateModuleImpl.downloadAndInstallApk(this.mUiCtx, options);
141
- }
142
-
143
134
  addListener(_eventName: string): void {
144
135
  logger.debug(TAG, ',call addListener');
145
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.37.4",
3
+ "version": "10.37.5",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {
package/src/client.ts CHANGED
@@ -282,19 +282,23 @@ export class Pushy {
282
282
  type: 'errorChecking',
283
283
  message: this.t('error_cannot_connect_backup', { message: e.message }),
284
284
  });
285
- const backupEndpoints = await this.getBackupEndpoints();
285
+ const backupEndpoints = await this.getBackupEndpoints().catch();
286
286
  if (backupEndpoints) {
287
- try {
288
- resp = await promiseAny(
289
- backupEndpoints.map(endpoint =>
290
- enhancedFetch(this.getCheckUrl(endpoint), fetchPayload),
291
- ),
292
- );
293
- } catch (err: any) {
294
- this.throwIfEnabled(Error('errorCheckingUseBackup'));
295
- }
287
+ resp = await promiseAny(
288
+ backupEndpoints.map(endpoint =>
289
+ enhancedFetch(this.getCheckUrl(endpoint), fetchPayload),
290
+ ),
291
+ ).catch(() => {
292
+ this.report({
293
+ type: 'errorChecking',
294
+ message: this.t('errorCheckingUseBackup'),
295
+ });
296
+ });
296
297
  } else {
297
- this.throwIfEnabled(Error('errorCheckingGetBackup'));
298
+ this.report({
299
+ type: 'errorChecking',
300
+ message: this.t('errorCheckingGetBackup'),
301
+ });
298
302
  }
299
303
  }
300
304
  if (!resp) {
@@ -316,7 +320,7 @@ export class Pushy {
316
320
  type: 'errorChecking',
317
321
  message: errorMessage,
318
322
  });
319
- this.throwIfEnabled(Error(errorMessage));
323
+ this.throwIfEnabled(Error('errorChecking: ' + errorMessage));
320
324
  return this.lastRespJson ? await this.lastRespJson : emptyObj;
321
325
  }
322
326
  this.lastRespJson = resp.json();