Fix Redis reusing same property as (#10336)

The collaborationClient getter was incorrectly reusing the same this.client
property as defaultClient, causing it to return the already-initialized
connection to the main Redis instead of creating a new connection to
REDIS_COLLABORATION_URL.

This fix adds a separate private static collabClient property to maintain
a separate connection for collaboration operations.

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
This commit is contained in:
codegen-sh[bot]
2025-10-10 09:00:20 -04:00
committed by GitHub
parent 7a148b0353
commit c8d8ba3914
+3 -2
View File
@@ -76,6 +76,7 @@ export default class RedisAdapter extends Redis {
private static client: RedisAdapter;
private static subscriber: RedisAdapter;
private static collabClient: RedisAdapter;
public static get defaultClient(): RedisAdapter {
return (
@@ -101,8 +102,8 @@ export default class RedisAdapter extends Redis {
*/
public static get collaborationClient(): RedisAdapter {
return (
this.client ||
(this.client = new this(env.REDIS_COLLABORATION_URL, {
this.collabClient ||
(this.collabClient = new this(env.REDIS_COLLABORATION_URL, {
connectionNameSuffix: "collab",
}))
);