@rotorsoft/act-tck 1.27.8 → 1.27.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.
@@ -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,IA28HtD,CAAC"}
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,IA88HtD,CAAC"}
package/dist/index.cjs CHANGED
@@ -1265,6 +1265,46 @@ var runStoreTck = (options) => {
1265
1265
  });
1266
1266
  (0, import_vitest9.expect)(full).toHaveLength(2);
1267
1267
  });
1268
+ (0, import_vitest9.it)("with_snaps applies the resume floor on a backward scan too", async () => {
1269
+ const s = `q-snap-back-${uid()}`;
1270
+ await store.commit(
1271
+ s,
1272
+ [inc(1), inc(1)],
1273
+ make_meta({ stream: s })
1274
+ );
1275
+ const [snap] = await store.commit(
1276
+ s,
1277
+ [{ name: import_act2.SNAP_EVENT, data: { count: 2 } }],
1278
+ make_meta({ stream: s })
1279
+ );
1280
+ await store.commit(
1281
+ s,
1282
+ [inc(1), inc(1), inc(1)],
1283
+ make_meta({ stream: s })
1284
+ );
1285
+ const backward = await collect(store, {
1286
+ stream: s,
1287
+ stream_exact: true,
1288
+ with_snaps: true,
1289
+ backward: true
1290
+ });
1291
+ (0, import_vitest9.expect)(backward).toHaveLength(4);
1292
+ (0, import_vitest9.expect)(backward[backward.length - 1].name).toBe(import_act2.SNAP_EVENT);
1293
+ (0, import_vitest9.expect)(backward.every((e) => e.id >= snap.id)).toBe(true);
1294
+ const s2 = `q-nosnap-back-${uid()}`;
1295
+ await store.commit(
1296
+ s2,
1297
+ [inc(1), inc(1)],
1298
+ make_meta({ stream: s2 })
1299
+ );
1300
+ const full = await collect(store, {
1301
+ stream: s2,
1302
+ stream_exact: true,
1303
+ with_snaps: true,
1304
+ backward: true
1305
+ });
1306
+ (0, import_vitest9.expect)(full).toHaveLength(2);
1307
+ });
1268
1308
  (0, import_vitest9.it)("supports backward traversal", async () => {
1269
1309
  const s = `q-back-${uid()}`;
1270
1310
  const committed = await store.commit(
@@ -4050,48 +4090,6 @@ var runStoreTck = (options) => {
4050
4090
  );
4051
4091
  (0, import_vitest9.expect)(bwd).toEqual([10]);
4052
4092
  });
4053
- (0, import_vitest9.it)("time-travel query ignores a snapshot newer than the created cutoff", async () => {
4054
- const s = `restore-tt-snap-${uid()}`;
4055
- const t0 = /* @__PURE__ */ new Date("2020-01-01T00:00:00.000Z");
4056
- const t1 = /* @__PURE__ */ new Date("2020-02-01T00:00:00.000Z");
4057
- const tSnap = /* @__PURE__ */ new Date("2020-03-01T00:00:00.000Z");
4058
- await restore(
4059
- as_source([
4060
- event(1, s, 0, "Incremented", t0, { amount: 1 }),
4061
- event(2, s, 1, "Incremented", t1, { amount: 2 }),
4062
- // Snapshot committed last → highest id and latest `created`.
4063
- event(3, s, 2, import_act2.SNAP_EVENT, tSnap, { count: 3 })
4064
- ])
4065
- );
4066
- const cutoff = /* @__PURE__ */ new Date("2020-01-15T00:00:00.000Z");
4067
- const before = [];
4068
- await store.query(
4069
- (e) => {
4070
- before.push(e.data.amount);
4071
- },
4072
- {
4073
- stream: s,
4074
- stream_exact: true,
4075
- with_snaps: true,
4076
- created_before: cutoff
4077
- }
4078
- );
4079
- (0, import_vitest9.expect)(before).toEqual([1]);
4080
- const after = [];
4081
- await store.query(
4082
- (e) => {
4083
- if (e.name !== import_act2.SNAP_EVENT)
4084
- after.push(e.data.amount);
4085
- },
4086
- {
4087
- stream: s,
4088
- stream_exact: true,
4089
- with_snaps: true,
4090
- created_after: cutoff
4091
- }
4092
- );
4093
- (0, import_vitest9.expect)(after).toEqual([2]);
4094
- });
4095
4093
  import_vitest9.it.skipIf(!caps.pii_isolation)(
4096
4094
  "isolates restored pii so forget_pii erases it",
4097
4095
  async () => {