@rotorsoft/act-tck 1.34.4 → 1.35.0

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
@@ -3295,7 +3295,7 @@ var runStoreTck = (options) => {
3295
3295
  });
3296
3296
  });
3297
3297
  describe8("truncate", () => {
3298
- it7("keeps the subscription row for a restart target, drops it for a retire (#1398)", async () => {
3298
+ it7("leaves subscriptions untouched for restart and retire alike (#1527)", async () => {
3299
3299
  const tag = uid();
3300
3300
  const restarted = `trunc-restart-${tag}`;
3301
3301
  const retired = `trunc-retire-${tag}`;
@@ -3321,7 +3321,24 @@ var runStoreTck = (options) => {
3321
3321
  limit: 100
3322
3322
  });
3323
3323
  expect8(rows).toContain(restarted);
3324
- expect8(rows).not.toContain(retired);
3324
+ expect8(rows).toContain(retired);
3325
+ });
3326
+ it7("leaves a retired stream's surviving subscription unclaimable (#1527)", async () => {
3327
+ const lane = `inert-lane-${uid()}`;
3328
+ const s = `trunc-inert-${uid()}`;
3329
+ const [e] = await store.commit(
3330
+ s,
3331
+ [inc(1)],
3332
+ make_meta({ stream: s })
3333
+ );
3334
+ await store.subscribe([{ stream: s, correlated_at: e.id, lane }]);
3335
+ const leased = await store.claim(100, 0, `w-${uid()}`, 1e4, lane);
3336
+ expect8(leased).toHaveLength(1);
3337
+ await store.ack([{ ...leased[0], at: e.id }]);
3338
+ await store.truncate([{ stream: s, meta: make_meta({ stream: s }) }]);
3339
+ expect8(
3340
+ await store.claim(100, 0, `w-${uid()}`, 1e4, lane)
3341
+ ).toHaveLength(0);
3325
3342
  });
3326
3343
  it7("seeds a tombstone when no snapshot is provided", async () => {
3327
3344
  const s = `trunc-tomb-${uid()}`;