@rotorsoft/act-tck 1.27.26 → 1.27.28

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.js CHANGED
@@ -2335,6 +2335,16 @@ var runStoreTck = (options) => {
2335
2335
  expect8(await store.defer([`missing-${uid()}`], Date.now())).toBe(0);
2336
2336
  expect8(await store.defer([], Date.now())).toBe(0);
2337
2337
  });
2338
+ it7("counts a duplicated stream name once (#1360)", async () => {
2339
+ const s = `defer-dup-${uid()}`;
2340
+ await store.subscribe([{ stream: s }]);
2341
+ await store.commit(
2342
+ s,
2343
+ [inc(1)],
2344
+ make_meta({ stream: s })
2345
+ );
2346
+ expect8(await store.defer([s, s], Date.now() + 36e5)).toBe(1);
2347
+ });
2338
2348
  });
2339
2349
  describe8("ack finalize (due-marked leases)", () => {
2340
2350
  it7("defers a due-marked lease instead of acking it", async () => {
@@ -2488,6 +2498,16 @@ var runStoreTck = (options) => {
2488
2498
  expect8(await store.reset([`missing-${uid()}`])).toBe(0);
2489
2499
  expect8(await store.reset([])).toBe(0);
2490
2500
  });
2501
+ it7("counts a duplicated stream name once (#1360)", async () => {
2502
+ const s = `reset-dup-${uid()}`;
2503
+ await store.subscribe([{ stream: s }]);
2504
+ await store.commit(
2505
+ s,
2506
+ [inc(1)],
2507
+ make_meta({ stream: s })
2508
+ );
2509
+ expect8(await store.reset([s, s])).toBe(1);
2510
+ });
2491
2511
  });
2492
2512
  describe8("unblock", () => {
2493
2513
  it7("clears blocked flag and preserves the watermark", async () => {
@@ -3257,6 +3277,36 @@ var runStoreTck = (options) => {
3257
3277
  const unknown = await store.query_stats([`qst-${tag}-missing`]);
3258
3278
  expect8(unknown.size).toBe(0);
3259
3279
  });
3280
+ it7("keyset pagination visits every stream regardless of name case (#1357)", async () => {
3281
+ const tag = uid();
3282
+ const names = [
3283
+ `${tag}-Bravo`,
3284
+ `${tag}-alpha`,
3285
+ `${tag}-Charlie`,
3286
+ `${tag}-delta`
3287
+ ];
3288
+ for (const s of names)
3289
+ await store.commit(
3290
+ s,
3291
+ [inc(1)],
3292
+ make_meta({ stream: s })
3293
+ );
3294
+ const visited = [];
3295
+ let after;
3296
+ let page = await store.query_stats(
3297
+ { stream: tag },
3298
+ { after, limit: 1 }
3299
+ );
3300
+ while (page.size > 0) {
3301
+ for (const k of page.keys()) visited.push(k);
3302
+ after = [...page.keys()].at(-1);
3303
+ page = await store.query_stats(
3304
+ { stream: tag },
3305
+ { after, limit: 1 }
3306
+ );
3307
+ }
3308
+ expect8([...visited].sort()).toEqual([...names].sort());
3309
+ });
3260
3310
  it7("tail returns the earliest event per stream", async () => {
3261
3311
  const tag = uid();
3262
3312
  const s = `qst-tail-${tag}`;