Skip to content

v5.5.4 — Idempotent message.redacted replay + dedupe repair

Latest

Choose a tag to compare

@Dekelelz Dekelelz released this 18 Apr 19:15

v5.5.3 fixed orphan redactions (redactions with no sent ancestor). This release fixes the next layer: duplicate redactions (multiple redactions of the same message).

The bug

The canonical replay threw on the second `message.redacted` event for the same message_id. The first redaction removes the message from the projection; the second one finds no record and hits:

`Canonical message replay cannot apply message.redacted because message X does not exist in the current branch projection.`

Any branch that had ever been Cleared twice (or migrated then Cleared) ended up with duplicates in the log and couldn't Clear Messages again.

The fix

  • `state/messages.js` — `message.redacted` is now idempotent. If the projection no longer contains the record, the replay treats the duplicate redaction as a no-op instead of throwing. The canonical log can legitimately carry multiple redactions per id — aborting the whole replay over that is worse than ignoring the duplicate.
  • `scripts/repair-canonical-events.js` — the repair now also dedupes duplicate `message.redacted` events per id (keeping the earliest). Dry-run and live reports show separate counts for `orphan_redacted` / `orphan_corrected` / `duplicate_redacted`.

How to heal an affected project

```bash
node .agent-bridge/launch.js repair --dry-run ""
node .agent-bridge/launch.js repair ""
```

Re-running the repair is safe — if there's nothing to fix it reports "no orphan or duplicate events" and exits.

Install / upgrade

```bash
npx let-them-talk@latest init
npm install -g let-them-talk@5.5.4
```

`npm audit`: 0 vulnerabilities.


Full changelog: `v5.5.3...v5.5.4`