Skip to content

fix(matrix): fresh installs no longer report an empty inbound dedupe migration in doctor changes - #122808

Merged
steipete merged 1 commit into
mainfrom
steipete/optimistic-leakey-914ff0
Aug 12, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/optimistic-leakey-914ff0

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where a pristine fresh OpenClaw profile's onboarding/doctor run printed a "Doctor changes" panel entry — "Auto-migrated legacy state: Recorded Matrix inbound dedupe migration completion (0 SQLite roots, 0 JSON roots scanned)" — on a brand-new install with nothing to migrate. Migration bookkeeping noise on the default out-of-box path.

Why This Change Was Made

The empty-scan durable receipt is intentional and stays exactly as is: it prevents a later-appearing historical database from being opened by the completed migration. Only the user-visible changes line is now suppressed when zero SQLite/JSON roots were scanned; any real scan (≥1 root) still reports the receipt line. The doctor panel already skips empty changes arrays (src/infra/state-migrations.doctor.ts), so a silent receipt produces no panel entry.

User Impact

Fresh installs no longer see a confusing "Auto-migrated legacy state" panel entry during onboarding/doctor. Installs with actual legacy Matrix inbound dedupe state see unchanged output.

Evidence

  • Updated extensions/matrix/doctor-contract-api.test.ts ("records an empty legacy scan silently and then skips historical databases"): asserts changes: [] on a fresh state dir, then proves the durable receipt still exists by dropping a historical database afterward and asserting detection stays null. Fails pre-fix (old code pushed the 0/0 line).
  • node scripts/run-vitest.mjs extensions/matrix/doctor-contract-api.test.ts extensions/matrix/doctor-contract-api.capacity.test.ts → 2 files, 19 tests passed.
  • Codex autoreview (gpt-5.6-sol, xhigh) on the diff: clean, no actionable findings.
  • Production LOC delta: +4 (two-line comment + conditional wrapper); other receipt-line tests scan ≥1 root and are unchanged.

…installs

On a pristine profile, onboarding/doctor printed "Auto-migrated legacy
state: Recorded Matrix inbound dedupe migration completion (0 SQLite
roots, 0 JSON roots scanned)" even though nothing was migrated. Keep
the durable empty-scan receipt (it still prevents later historical
databases from being opened) but only emit the user-visible change line
when at least one SQLite/JSON root was scanned.
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 12, 2026 20:46
@openclaw-barnacle openclaw-barnacle Bot added channel: matrix Channel integration: matrix size: XS maintainer Maintainer-authored PR labels Aug 12, 2026
@steipete
steipete merged commit 468dc55 into main Aug 12, 2026
150 of 153 checks passed
@steipete
steipete deleted the steipete/optimistic-leakey-914ff0 branch August 12, 2026 20:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 13, 2026
…installs (openclaw#122808)

On a pristine profile, onboarding/doctor printed "Auto-migrated legacy
state: Recorded Matrix inbound dedupe migration completion (0 SQLite
roots, 0 JSON roots scanned)" even though nothing was migrated. Keep
the durable empty-scan receipt (it still prevents later historical
databases from being opened) but only emit the user-visible change line
when at least one SQLite/JSON root was scanned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant