@dotrino/identity 0.133.0 → 0.133.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vault/core.js +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotrino/identity",
3
- "version": "0.133.0",
3
+ "version": "0.133.1",
4
4
  "description": "Identidad y rating de usuarios compartidos entre apps de Dotrino (vault iframe + postMessage)",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/vault/core.js CHANGED
@@ -3372,6 +3372,19 @@ export async function createIdentityCore ({ kv: hostKv, peers, makeSync = null,
3372
3372
  if (!res || typeof res !== 'object' || !res.__enc) {
3373
3373
  throw Object.assign(new Error('the vault replied to the store without encrypting it'), { code: 'vault-reply-unsealed' })
3374
3374
  }
3375
+ // LA BÓVEDA CONTESTA CON SU GENERACIÓN, que puede ser más nueva que mi acta (2026-10-27:
3376
+ // el navegador del messenger en un acta anterior a la #74 y la bóveda cerrando con la
3377
+ // generación 11, que nació en la #74). Solo la página /vault ponía al día el acta, así
3378
+ // que fuera de ella el almacén fallaba para siempre. Me pongo al día por el camino de
3379
+ // siempre (la lista trae el acta y la cadena de selladoras) y la abro con la que llegue.
3380
+ const hasGen = () => (loadActa()?.keyring || []).some((g) => g.gen === res.__enc?.gen && g.wraps?.[publickeyJwkStr])
3381
+ if (!hasGen()) {
3382
+ const antes = loadActa()?.seq ?? null
3383
+ await handlers.listVaultDevices()
3384
+ if (!hasGen()) {
3385
+ throw Object.assign(new Error(`the vault replied with content key generation ${res.__enc?.gen} and this device, on record #${loadActa()?.seq ?? antes}, does not hold it`), { code: 'content-gen-ahead' })
3386
+ }
3387
+ }
3375
3388
  return JSON.parse(await Content.decryptWithKeyring({
3376
3389
  envelope: res.__enc, keyring: loadActa()?.keyring, myPub: publickeyJwkStr, myEncPrivateKey: encKeypair.privateKey
3377
3390
  }))