@rotorsoft/act 2.1.2 → 2.1.3
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/.tsbuildinfo +1 -1
- package/dist/@types/internal/event-sourcing.d.ts.map +1 -1
- package/dist/@types/types/restore.d.ts +6 -4
- package/dist/@types/types/restore.d.ts.map +1 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1263,6 +1263,7 @@ async function scan(source, opts = {}, callback) {
|
|
|
1263
1263
|
let migrated_count = 0;
|
|
1264
1264
|
let processed = 0;
|
|
1265
1265
|
let at;
|
|
1266
|
+
const started = /* @__PURE__ */ new Set();
|
|
1266
1267
|
const closed_streams = /* @__PURE__ */ new Set();
|
|
1267
1268
|
if (drop_closed_streams) {
|
|
1268
1269
|
await source.query(
|
|
@@ -1291,7 +1292,9 @@ async function scan(source, opts = {}, callback) {
|
|
|
1291
1292
|
if (!is_valid(event))
|
|
1292
1293
|
throw new Error(`Invalid event at index ${processed}`);
|
|
1293
1294
|
if (on_progress) on_progress({ processed, id: event.id, max_id });
|
|
1294
|
-
|
|
1295
|
+
const has_history = started.has(event.stream);
|
|
1296
|
+
started.add(event.stream);
|
|
1297
|
+
if (drop_snapshots && event.name === SNAP_EVENT && has_history) {
|
|
1295
1298
|
dropped_snaps++;
|
|
1296
1299
|
return;
|
|
1297
1300
|
}
|