Skip to content

Commit e688cd2

Browse files
claude[bot]ymc9
andcommitted
fix(orm): clone QueryInfo objects in () to prevent mutation
- Change from [...this.slowQueries] to this.slowQueries.map((query) => ({ ...query })) - Prevents callers from mutating the shared slowQueries buffer - Ensures each QueryInfo object is properly shallow-copied Co-authored-by: Yiming Cao <ymc9@users.noreply.github.com>
1 parent e1ae8b6 commit e688cd2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/orm/src/client/client-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ export class ClientImpl {
433433
async $diagnostics(): Promise<Diagnostics> {
434434
return {
435435
zodCache: this.inputValidator.zodFactory.cacheStats,
436-
slowQueries: [...this.slowQueries],
436+
slowQueries: this.slowQueries.map((query) => ({ ...query })),
437437
};
438438
}
439439

0 commit comments

Comments
 (0)