The stub path checks the room id, as the ledger path does
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
6293c36add
commit
dc4d2a1221
@@ -150,7 +150,10 @@ export function ledgerStat(roomId: string): { bytes: number; mtimeMs: number } |
|
||||
// the room's whole truth and the room stays asleep, unreplayed.
|
||||
|
||||
const stubDir = () => join(DATA_DIR, "..", "stubs");
|
||||
const stubFor = (roomId: string) => join(stubDir(), `${roomId}.json`);
|
||||
function stubFor(roomId: string): string {
|
||||
if (!safeRoomId(roomId)) throw new Error(`unsafe room id: ${JSON.stringify(roomId)}`);
|
||||
return join(stubDir(), `${roomId}.json`);
|
||||
}
|
||||
|
||||
export function readStubFile<T>(roomId: string): { bytes: number; stub: T } | null {
|
||||
if (!safeRoomId(roomId)) return null;
|
||||
|
||||
Reference in New Issue
Block a user