File tree 3 files changed +11
-5
lines changed
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,8 @@ describe("Ignore action tests", () => {
158
158
}
159
159
160
160
room_id = data ?. room_id ;
161
+ console . log ( "*** data" , data ) ;
162
+ console . log ( "Room ID" , room_id ) ;
161
163
162
164
await cleanup ( ) ;
163
165
} ) ;
@@ -187,7 +189,7 @@ describe("Ignore action tests", () => {
187
189
188
190
return result . action === "IGNORE" ;
189
191
} ) ;
190
- } , 60000 ) ;
192
+ } , 120000 ) ;
191
193
192
194
test ( "Action handler test 1: response should be ignore" , async ( ) => {
193
195
await runAiTest (
@@ -212,7 +214,7 @@ describe("Ignore action tests", () => {
212
214
return ( lastMessage . content as Content ) . action === "IGNORE" ;
213
215
} ,
214
216
) ;
215
- } , 60000 ) ;
217
+ } , 120000 ) ;
216
218
217
219
test ( "Action handler test 2: response should be ignore" , async ( ) => {
218
220
await runAiTest (
@@ -237,7 +239,7 @@ describe("Ignore action tests", () => {
237
239
return ( lastMessage . content as Content ) . action === "IGNORE" ;
238
240
} ,
239
241
) ;
240
- } , 60000 ) ;
242
+ } , 120000 ) ;
241
243
242
244
test ( "Expect ignore" , async ( ) => {
243
245
await runAiTest ( "Expect ignore" , async ( ) => {
@@ -257,5 +259,5 @@ describe("Ignore action tests", () => {
257
259
258
260
return ( lastMessage . content as Content ) . action === "IGNORE" ;
259
261
} ) ;
260
- } , 60000 ) ;
262
+ } , 120000 ) ;
261
263
} ) ;
Original file line number Diff line number Diff line change @@ -425,6 +425,7 @@ AND room_id = ?`;
425
425
}
426
426
427
427
async createRoom ( room_id ?: UUID ) : Promise < UUID > {
428
+ room_id = room_id || ( v4 ( ) as UUID ) ;
428
429
try {
429
430
const sql = "INSERT INTO rooms (id) VALUES (?)" ;
430
431
this . db . prepare ( sql ) . run ( room_id ?? ( v4 ( ) as UUID ) ) ;
Original file line number Diff line number Diff line change @@ -25,13 +25,16 @@ export async function getOrCreateRelationship({
25
25
26
26
let room_id : UUID ;
27
27
if ( ! rooms || rooms . length === 0 ) {
28
+ console . log ( "No room found for participants" ) ;
28
29
// If no room exists, create a new room for the relationship
29
30
room_id = await runtime . databaseAdapter . createRoom ( ) ;
31
+ console . log ( "Created room" , room_id ) ;
30
32
31
33
// Add participants to the newly created room
32
34
await runtime . databaseAdapter . addParticipant ( userA , room_id ) ;
33
35
await runtime . databaseAdapter . addParticipant ( userB , room_id ) ;
34
36
} else {
37
+ console . log ( "Room found for participants" , rooms [ 0 ] ) ;
35
38
// If a room already exists, use the existing room
36
39
room_id = rooms [ 0 ] ;
37
40
}
@@ -49,5 +52,5 @@ export async function getOrCreateRelationship({
49
52
throw new Error ( "Failed to fetch the created relationship" ) ;
50
53
}
51
54
}
52
- return { ...relationship , room_id : room_id } ;
55
+ return { ...relationship , room_id } ;
53
56
}
You can’t perform that action at this time.
0 commit comments