mikser-io 9.25.0 → 9.25.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mikser-io",
3
- "version": "9.25.0",
3
+ "version": "9.25.1",
4
4
  "description": "<p align=\"center\"> <img src=\"mikser-lockup-stacked.svg\" alt=\"mikser\" width=\"198\" /> </p>",
5
5
  "main": "index.js",
6
6
  "exports": {
package/src/catalog.js CHANGED
@@ -226,6 +226,13 @@ async function applyJournalMutations() {
226
226
  logger.trace('Database %s %s: %s', entity.collection, operation, entity.id)
227
227
  stmtDelete.run(entity.id)
228
228
  // FK ON DELETE CASCADE handles mikser_refs cleanup.
229
+ // mikser_failures is cleared explicitly rather than by
230
+ // cascade — see manifest.clearFailures for why it cannot
231
+ // be a foreign key. Left behind, one row for a deleted
232
+ // entity keeps the dispatch set non-empty for the life of
233
+ // the database, so layouts' idle-cycle early-out never
234
+ // fires again.
235
+ runtime.manifest?.clearFailures(entity.id)
229
236
  cacheEvict(entity.id)
230
237
  break
231
238
  }
package/src/manifest.js CHANGED
@@ -297,6 +297,9 @@ export function createManifest(db) {
297
297
  const stmtClearFailure = db.prepare(`
298
298
  DELETE FROM mikser_failures WHERE id = ? AND destination = ?
299
299
  `)
300
+ const stmtClearFailuresForId = db.prepare(`
301
+ DELETE FROM mikser_failures WHERE id = ?
302
+ `)
300
303
  const stmtFailuresFor = db.prepare(`
301
304
  SELECT id, destination, error, context, firstFailedAt, lastFailedAt, attempts
302
305
  FROM mikser_failures WHERE id = ?
@@ -581,6 +584,24 @@ export function createManifest(db) {
581
584
  })
582
585
  },
583
586
 
587
+ // The entity is gone, so every failure recorded against it is
588
+ // irrelevant regardless of which destination it was recorded at.
589
+ //
590
+ // Deliberately NOT a foreign key with ON DELETE CASCADE, which is how
591
+ // mikser_refs handles the same situation: a render task's id is not
592
+ // guaranteed to be a row in mikser_entities — snapshots carry a
593
+ // `parent` precisely because paginated children render under derived
594
+ // ids — so an FK would make recordFailure throw from inside the
595
+ // handler that exists to report a render error, turning a reported
596
+ // failure into a crash.
597
+ //
598
+ // A rename presents as delete + create under a new id, so this covers
599
+ // that residue too: the old id's rows go with the delete.
600
+ clearFailures(id) {
601
+ if (!id) return
602
+ stmtClearFailuresForId.run(id)
603
+ },
604
+
584
605
  // A render succeeded, so whatever was recorded about it failing is
585
606
  // no longer true. Called on every success, not only after a failure —
586
607
  // it is a cheap DELETE and forgetting it would strand the marker.