@rotorsoft/act-tck 1.27.34 → 1.27.35

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
@@ -2176,6 +2176,31 @@ var runStoreTck = (options) => {
2176
2176
  const again = await store.claim(100, 100, `w2-${uid()}`, 1e5);
2177
2177
  expect8(again.find((l) => l.stream === s)).toBeUndefined();
2178
2178
  });
2179
+ it7("returns the post-block row, not the caller's lease (#1382)", async () => {
2180
+ const s = `block-returns-${uid()}`;
2181
+ await store.subscribe([{ stream: s }]);
2182
+ await store.commit(
2183
+ s,
2184
+ [inc(1)],
2185
+ make_meta({ stream: s })
2186
+ );
2187
+ const leased = await store.claim(100, 0, `w-${uid()}`, 1e5);
2188
+ const mine = leased.find((l) => l.stream === s);
2189
+ expect8(mine).toBeDefined();
2190
+ await store.ack(leased.filter((l) => l.stream !== s));
2191
+ const blocked = await store.block([
2192
+ { ...mine, at: 999999, error: "boom" }
2193
+ ]);
2194
+ expect8(blocked).toHaveLength(1);
2195
+ let durable_at;
2196
+ await store.query_streams(
2197
+ (p) => {
2198
+ durable_at = p.at;
2199
+ },
2200
+ { stream: s, stream_exact: true }
2201
+ );
2202
+ expect8(blocked[0].at).toBe(durable_at);
2203
+ });
2179
2204
  it7("rejects block calls from a different holder", async () => {
2180
2205
  const s = `block-wrong-${uid()}`;
2181
2206
  await store.subscribe([{ stream: s }]);