mikser-io 11.10.1 → 11.10.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/journal.js +27 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mikser-io",
3
- "version": "11.10.1",
3
+ "version": "11.10.2",
4
4
  "files": [
5
5
  "app.js",
6
6
  "index.js",
package/src/journal.js CHANGED
@@ -336,5 +336,31 @@ onFinalized(async () => {
336
336
  })
337
337
 
338
338
  onCancelled(async () => {
339
- clearJournal()
339
+ // NOT cleared. A cancelled cycle's entries are not superseded work —
340
+ // "this entity was created and nothing has processed it" is still true
341
+ // after the restart, and the restarted cycle will not re-journal it: the
342
+ // source gate compares checksums, finds the file unchanged, and emits
343
+ // nothing. So deleting these rows orphaned the entity permanently. It sat
344
+ // in the catalog with empty meta, no output, and no journal entry any
345
+ // future cycle would look at, under a green "Mikser completed" — and
346
+ // touching the file was the only way to get it back.
347
+ //
348
+ // Reported against a 4 MB PDF uploaded over WebDAV: the upload landed
349
+ // mid-cycle, the restart deleted the CREATE entry, and the page was never
350
+ // produced. Nothing about it was specific to the plugin that noticed —
351
+ // any consumer doing real work between a journal read and its write-back
352
+ // had the same hole.
353
+ //
354
+ // The asymmetry was the tell: a CRASH leaves these rows and `--resume`
355
+ // continues from them (see the leftover bootstrap above), while a restart
356
+ // deliberately deleted them. Keeping them makes a restart behave like the
357
+ // case the engine already handles.
358
+ //
359
+ // They are cleared by onFinalized when a cycle actually completes, so a
360
+ // run of cancellations carries its backlog forward and the first cycle to
361
+ // finish clears the lot.
362
+ const carried = stmtCount.get().n
363
+ if (carried > 0) {
364
+ useLogger()?.debug('Restart: carrying %d unprocessed journal entries into the next cycle', carried)
365
+ }
340
366
  })