Skip to content

Commit 6f483dd

Browse files
authored
Merge pull request #173 from objectstack-ai/copilot/fix-action-run-issue-again
2 parents d3426c5 + 2f67c76 commit 6f483dd

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

packages/drivers/redis/src/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@ export class RedisDriver implements Driver, DriverInterface {
563563

564564
for (let i = 0; i < command.updates.length; i++) {
565565
const update = command.updates[i];
566-
const result = getResults?.[i] as any;
567-
const existingData = result?.[1];
566+
// Redis v4 client returns array of results directly, not [error, result] tuples
567+
const existingData = getResults?.[i];
568568

569569
if (existingData && typeof existingData === 'string') {
570570
const existingDoc = JSON.parse(existingData);
@@ -581,7 +581,10 @@ export class RedisDriver implements Driver, DriverInterface {
581581
}
582582
}
583583

584-
await setPipeline.exec();
584+
// Only execute pipeline if there are commands to execute
585+
if (updateResults.length > 0) {
586+
await setPipeline.exec();
587+
}
585588

586589
return {
587590
success: true,
@@ -602,7 +605,9 @@ export class RedisDriver implements Driver, DriverInterface {
602605
}
603606

604607
const deleteResults = await deletePipeline.exec();
605-
const deleted = deleteResults?.filter((r: any) => r && r[1] > 0).length || 0;
608+
// Redis v4 client returns array of results directly, not [error, result] tuples
609+
// Each DEL returns 1 if key existed and was deleted, 0 if key didn't exist
610+
const deleted = deleteResults?.filter((r: any) => r > 0).length || 0;
606611

607612
return {
608613
success: true,

packages/runtime/server/test/graphql.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ describe('GraphQL API Adapter', () => {
146146
}
147147
}
148148
});
149+
150+
await app.init();
149151

150152
// Create handler and server once for all tests
151153
handler = createGraphQLHandler(app);

packages/runtime/server/test/node.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ describe('Node Adapter', () => {
5151
}
5252
}
5353
});
54+
55+
await app.init();
5456
});
5557

5658
it('should handle find request', async () => {

packages/runtime/server/test/rest-advanced.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ describe('REST API Error Handling & Edge Cases', () => {
133133
}
134134
}
135135
});
136+
137+
await app.init();
136138

137139
handler = createRESTHandler(app);
138140
server = createServer(handler);

packages/runtime/server/test/rest.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ describe('REST API Adapter', () => {
201201
}
202202
}
203203
});
204+
205+
await app.init();
204206

205207
// Create handler and server once for all tests
206208
handler = createRESTHandler(app);

0 commit comments

Comments
 (0)