refactor: finish legacy room cleanup and explicit migration boundary

This commit is contained in:
ejclaw
2026-04-10 23:12:54 +09:00
parent 497e6dec74
commit 921c241873
11 changed files with 1028 additions and 878 deletions

View File

@@ -142,7 +142,6 @@ import {
getRegisteredAgentTypesForJidFromDatabase,
getRegisteredGroupFromDatabase,
getStoredRoomSettingsFromDatabase,
migrateLegacyRoomRegistrationsForTestsInDatabase,
setExplicitRoomModeInDatabase,
setRegisteredGroupForTestsInDatabase,
setStoredRoomOwnerAgentTypeForTestsInDatabase,
@@ -678,10 +677,7 @@ export function getRegisteredGroup(
return getRegisteredGroupFromDatabase(db, jid, agentType);
}
/**
* @internal Test/migration helper for seeding legacy capability rows.
* Runtime code must use assignRoom() so room_settings remains the explicit SSOT.
*/
/** @internal Test helper for seeding canonical room bindings. */
export function _setRegisteredGroupForTests(
jid: string,
group: RegisteredGroup,
@@ -689,16 +685,6 @@ export function _setRegisteredGroupForTests(
setRegisteredGroupForTestsInDatabase(db, jid, group);
}
export function _migrateLegacyRoomRegistrationsForTests(): {
migratedRooms: number;
migratedRoleOverrides: number;
} {
if (!db) {
throw new Error('Database not initialized');
}
return migrateLegacyRoomRegistrationsForTestsInDatabase(db);
}
export function assignRoom(
chatJid: string,
input: AssignRoomInput,