@abraca/dabra 2.31.0 → 2.32.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.
@@ -17395,6 +17395,7 @@ var DeviceRegistrationService = class {
17395
17395
  return;
17396
17396
  }
17397
17397
  const devicesMap = identityDoc.devicesMap;
17398
+ const pendingRevocations = [];
17398
17399
  devicesMap.forEach((yEntry, devicePub) => {
17399
17400
  const serverEntry = yEntry.get("servers")?.get(serverUrl);
17400
17401
  const serverKey = serverKeys.find((k) => k.publicKey === devicePub);
@@ -17413,11 +17414,16 @@ var DeviceRegistrationService = class {
17413
17414
  lastVerifiedAt: Date.now(),
17414
17415
  keyId: serverKey.id
17415
17416
  });
17416
- if (revokedAt && isMaster) client.revokeKey(serverKey.id).then(() => {
17417
- identityDoc.setDeviceServerStatus(devicePub, serverUrl, { registered: false });
17418
- }).catch(() => {});
17417
+ if (revokedAt && isMaster) pendingRevocations.push({
17418
+ devicePub,
17419
+ keyId: serverKey.id
17420
+ });
17419
17421
  }
17420
17422
  });
17423
+ for (const { devicePub, keyId } of pendingRevocations) try {
17424
+ await client.revokeKey(keyId);
17425
+ identityDoc.setDeviceServerStatus(devicePub, serverUrl, { registered: false });
17426
+ } catch {}
17421
17427
  for (const key of serverKeys) {
17422
17428
  if (key.revoked) continue;
17423
17429
  if (!devicesMap.has(key.publicKey)) identityDoc.addDevice(key.publicKey, {