Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions packages/drivers/redis/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ export class RedisDriver implements Driver, DriverInterface {

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

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

await setPipeline.exec();
// Only execute pipeline if there are commands to execute
if (updateResults.length > 0) {
await setPipeline.exec();
}

return {
success: true,
Expand All @@ -602,7 +605,9 @@ export class RedisDriver implements Driver, DriverInterface {
}

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

return {
success: true,
Expand Down
2 changes: 2 additions & 0 deletions packages/runtime/server/test/graphql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ describe('GraphQL API Adapter', () => {
}
}
});

await app.init();

// Create handler and server once for all tests
handler = createGraphQLHandler(app);
Expand Down
2 changes: 2 additions & 0 deletions packages/runtime/server/test/node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ describe('Node Adapter', () => {
}
}
});

await app.init();
});

it('should handle find request', async () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/runtime/server/test/rest-advanced.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ describe('REST API Error Handling & Edge Cases', () => {
}
}
});

await app.init();

handler = createRESTHandler(app);
server = createServer(handler);
Expand Down
2 changes: 2 additions & 0 deletions packages/runtime/server/test/rest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ describe('REST API Adapter', () => {
}
}
});

await app.init();

// Create handler and server once for all tests
handler = createRESTHandler(app);
Expand Down
Loading