@abraca/dabra 2.31.0 → 2.33.0

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.
@@ -17342,6 +17342,7 @@ var DeviceRegistrationService = class {
17342
17342
  return;
17343
17343
  }
17344
17344
  const devicesMap = identityDoc.devicesMap;
17345
+ const pendingRevocations = [];
17345
17346
  devicesMap.forEach((yEntry, devicePub) => {
17346
17347
  const serverEntry = yEntry.get("servers")?.get(serverUrl);
17347
17348
  const serverKey = serverKeys.find((k) => k.publicKey === devicePub);
@@ -17360,11 +17361,16 @@ var DeviceRegistrationService = class {
17360
17361
  lastVerifiedAt: Date.now(),
17361
17362
  keyId: serverKey.id
17362
17363
  });
17363
- if (revokedAt && isMaster) client.revokeKey(serverKey.id).then(() => {
17364
- identityDoc.setDeviceServerStatus(devicePub, serverUrl, { registered: false });
17365
- }).catch(() => {});
17364
+ if (revokedAt && isMaster) pendingRevocations.push({
17365
+ devicePub,
17366
+ keyId: serverKey.id
17367
+ });
17366
17368
  }
17367
17369
  });
17370
+ for (const { devicePub, keyId } of pendingRevocations) try {
17371
+ await client.revokeKey(keyId);
17372
+ identityDoc.setDeviceServerStatus(devicePub, serverUrl, { registered: false });
17373
+ } catch {}
17368
17374
  for (const key of serverKeys) {
17369
17375
  if (key.revoked) continue;
17370
17376
  if (!devicesMap.has(key.publicKey)) identityDoc.addDevice(key.publicKey, {