mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(matrix): silence empty inbound dedupe migration receipt on fresh installs (#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.
This commit is contained in:
committed by
GitHub
parent
391b8ae0a5
commit
468dc55a39
@@ -765,7 +765,7 @@ describe("matrix doctor contract state migrations", () => {
|
||||
await expect(migration.detectLegacyState(createMigrationParams(stateDir))).resolves.toBeNull();
|
||||
});
|
||||
|
||||
it("records an empty legacy scan and then skips historical databases", async () => {
|
||||
it("records an empty legacy scan silently and then skips historical databases", async () => {
|
||||
const stateDir = tempDirs.make("openclaw-matrix-doctor-");
|
||||
const migration = migrationById("matrix-inbound-dedupe-to-claimable-dedupe");
|
||||
const params = createMigrationParams(stateDir);
|
||||
@@ -773,10 +773,10 @@ describe("matrix doctor contract state migrations", () => {
|
||||
await expect(migration.detectLegacyState(params)).resolves.toEqual({
|
||||
preview: ["Matrix inbound dedupe legacy sources need a one-time migration scan"],
|
||||
});
|
||||
// Fresh installs scan nothing: the durable receipt is recorded (proven by
|
||||
// the historical-database skip below) without a user-visible change line.
|
||||
await expect(migration.migrateLegacyState(params)).resolves.toEqual({
|
||||
changes: [
|
||||
"Recorded Matrix inbound dedupe migration completion (0 SQLite roots, 0 JSON roots scanned)",
|
||||
],
|
||||
changes: [],
|
||||
warnings: [],
|
||||
});
|
||||
const lateDatabasePath = path.join(
|
||||
|
||||
@@ -346,9 +346,13 @@ export const stateMigrations: PluginDoctorStateMigration[] = [
|
||||
}
|
||||
try {
|
||||
await recordMatrixInboundDedupeMigrationCompletion(params.context, params.env);
|
||||
changes.push(
|
||||
`Recorded Matrix inbound dedupe migration completion (${sources.sqliteRoots.length} SQLite roots, ${sources.jsonRoots.length} JSON roots scanned)`,
|
||||
);
|
||||
// Fresh installs scan zero roots; keep the durable receipt silent
|
||||
// there so onboarding doesn't report a migration that touched nothing.
|
||||
if (sources.sqliteRoots.length + sources.jsonRoots.length > 0) {
|
||||
changes.push(
|
||||
`Recorded Matrix inbound dedupe migration completion (${sources.sqliteRoots.length} SQLite roots, ${sources.jsonRoots.length} JSON roots scanned)`,
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
warnings.push(
|
||||
`Failed recording Matrix inbound dedupe migration completion: ${String(err)}`,
|
||||
|
||||
Reference in New Issue
Block a user