@rotorsoft/act-tck 1.28.0 → 1.28.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAQV,KAAK,EAEN,MAAM,sBAAsB,CAAC;AAc9B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,OAAO,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,YAAa,eAAe,KAAG,IA2wItD,CAAC"}
1
+ {"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAQV,KAAK,EAGN,MAAM,sBAAsB,CAAC;AAc9B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,OAAO,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,YAAa,eAAe,KAAG,IAszItD,CAAC"}
package/dist/index.cjs CHANGED
@@ -1744,6 +1744,31 @@ var runStoreTck = (options) => {
1744
1744
  (0, import_vitest9.expect)(leasedB.find((l) => l.stream === s)).toBeUndefined();
1745
1745
  (0, import_vitest9.expect)(leasedB.find((l) => l.stream === other)).toBeDefined();
1746
1746
  });
1747
+ (0, import_vitest9.it)("drops the ack of a holder whose lease was taken, and accrues retry per claim", async () => {
1748
+ const s = `claim-stolen-${uid()}`;
1749
+ await store.subscribe([{ stream: s }]);
1750
+ await store.commit(
1751
+ s,
1752
+ [inc(1), inc(2)],
1753
+ make_meta({ stream: s })
1754
+ );
1755
+ const leasedA = await store.claim(100, 0, `wA-${uid()}`, 1);
1756
+ const a = leasedA.find((l) => l.stream === s);
1757
+ (0, import_vitest9.expect)(a).toBeDefined();
1758
+ (0, import_vitest9.expect)(a.retry).toBe(0);
1759
+ await new Promise((r) => setTimeout(r, 50));
1760
+ const leasedB = await store.claim(100, 0, `wB-${uid()}`, 1e5);
1761
+ const b = leasedB.find((l) => l.stream === s);
1762
+ (0, import_vitest9.expect)(b).toBeDefined();
1763
+ (0, import_vitest9.expect)(b.retry).toBe(1);
1764
+ const late = await store.ack([{ ...a, at: a.at + 1 }]);
1765
+ (0, import_vitest9.expect)(late).toEqual([]);
1766
+ const rows = [];
1767
+ await store.query_streams((r) => rows.push(r), { stream: s });
1768
+ (0, import_vitest9.expect)(rows[0]?.at).toBe(a.at);
1769
+ (0, import_vitest9.expect)(rows[0]?.retry).toBe(1);
1770
+ (0, import_vitest9.expect)(rows[0]?.blocked).toBe(false);
1771
+ });
1747
1772
  (0, import_vitest9.it)("supports dual frontiers (lagging + leading)", async () => {
1748
1773
  const s = `claim-dual-${uid()}`;
1749
1774
  await store.subscribe([{ stream: s }]);