@rotorsoft/act-tck 1.26.8 → 1.26.9

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/dist/index.cjs CHANGED
@@ -1874,6 +1874,28 @@ var runStoreTck = (options) => {
1874
1874
  const leased = await store.claim(100, 100, `w-${uid()}`, 1e5);
1875
1875
  (0, import_vitest9.expect)(leased.find((l) => l.stream === s)).toBeDefined();
1876
1876
  });
1877
+ (0, import_vitest9.it)("exposes a future deferred_at via query_streams (#1221)", async () => {
1878
+ const deferred = `defer-qs-${uid()}`;
1879
+ const plain = `defer-qs-plain-${uid()}`;
1880
+ await store.subscribe([{ stream: deferred }, { stream: plain }]);
1881
+ for (const s of [deferred, plain])
1882
+ await store.commit(
1883
+ s,
1884
+ [inc(1)],
1885
+ make_meta({ stream: s })
1886
+ );
1887
+ const due = Date.now() + 36e5;
1888
+ await store.defer([deferred], due);
1889
+ const seen = /* @__PURE__ */ new Map();
1890
+ await store.query_streams((p) => {
1891
+ if (p.stream === deferred || p.stream === plain)
1892
+ seen.set(p.stream, p.deferred_at);
1893
+ });
1894
+ const got = seen.get(deferred);
1895
+ (0, import_vitest9.expect)(got).toBeDefined();
1896
+ (0, import_vitest9.expect)(Math.abs(got - due)).toBeLessThan(2e3);
1897
+ (0, import_vitest9.expect)(seen.get(plain)).toBeUndefined();
1898
+ });
1877
1899
  (0, import_vitest9.it)("defers streams matching a filter and counts matches", async () => {
1878
1900
  const tag = uid();
1879
1901
  const a = `deferfilter-${tag}-a`;