diff --git a/src/lib/actions/__tests__/ignore.test.ts b/src/lib/actions/__tests__/ignore.test.ts index 3d7ee26..30996d1 100644 --- a/src/lib/actions/__tests__/ignore.test.ts +++ b/src/lib/actions/__tests__/ignore.test.ts @@ -158,6 +158,8 @@ describe("Ignore action tests", () => { } room_id = data?.room_id; + console.log("*** data", data); + console.log("Room ID", room_id); await cleanup(); }); @@ -187,7 +189,7 @@ describe("Ignore action tests", () => { return result.action === "IGNORE"; }); - }, 60000); + }, 120000); test("Action handler test 1: response should be ignore", async () => { await runAiTest( @@ -212,7 +214,7 @@ describe("Ignore action tests", () => { return (lastMessage.content as Content).action === "IGNORE"; }, ); - }, 60000); + }, 120000); test("Action handler test 2: response should be ignore", async () => { await runAiTest( @@ -237,7 +239,7 @@ describe("Ignore action tests", () => { return (lastMessage.content as Content).action === "IGNORE"; }, ); - }, 60000); + }, 120000); test("Expect ignore", async () => { await runAiTest("Expect ignore", async () => { @@ -257,5 +259,5 @@ describe("Ignore action tests", () => { return (lastMessage.content as Content).action === "IGNORE"; }); - }, 60000); + }, 120000); }); diff --git a/src/lib/adapters/sqlite.ts b/src/lib/adapters/sqlite.ts index 73d3bb6..e6ba754 100644 --- a/src/lib/adapters/sqlite.ts +++ b/src/lib/adapters/sqlite.ts @@ -425,6 +425,7 @@ AND room_id = ?`; } async createRoom(room_id?: UUID): Promise { + room_id = room_id || (v4() as UUID); try { const sql = "INSERT INTO rooms (id) VALUES (?)"; this.db.prepare(sql).run(room_id ?? (v4() as UUID)); diff --git a/src/test/getOrCreateRelationship.ts b/src/test/getOrCreateRelationship.ts index 4572fe7..0f53fa3 100644 --- a/src/test/getOrCreateRelationship.ts +++ b/src/test/getOrCreateRelationship.ts @@ -25,13 +25,16 @@ export async function getOrCreateRelationship({ let room_id: UUID; if (!rooms || rooms.length === 0) { + console.log("No room found for participants"); // If no room exists, create a new room for the relationship room_id = await runtime.databaseAdapter.createRoom(); + console.log("Created room", room_id); // Add participants to the newly created room await runtime.databaseAdapter.addParticipant(userA, room_id); await runtime.databaseAdapter.addParticipant(userB, room_id); } else { + console.log("Room found for participants", rooms[0]); // If a room already exists, use the existing room room_id = rooms[0]; } @@ -49,5 +52,5 @@ export async function getOrCreateRelationship({ throw new Error("Failed to fetch the created relationship"); } } - return { ...relationship, room_id: room_id }; + return { ...relationship, room_id }; }