@cero-base/core 2.3.0 → 2.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cero-base/core",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "cero p2p primitives — identity, storage, network, database, blobs, rpc, pairing.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -762,12 +762,15 @@ export class Database extends ReadyResource {
762
762
  /** @private */
763
763
  _inHook(fn) {
764
764
  return async (ctx) => {
765
+ // only the hook's own synchronous run is inside it: other work interleaves at its awaits
765
766
  this._hooking++
767
+ let result
766
768
  try {
767
- return await fn(ctx)
769
+ result = fn(ctx)
768
770
  } finally {
769
771
  this._hooking--
770
772
  }
773
+ return await result
771
774
  }
772
775
  }
773
776