Skip to content

Commit 16d620c

Browse files
Owen PearsonOwen Pearson
authored andcommitted
fix: don't compare agent channel param when determining whether channel options require reattach
1 parent e3e6781 commit 16d620c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/common/lib/client/realtimechannel.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,14 @@ class RealtimeChannel extends Channel {
189189
return false;
190190
}
191191
if (options?.params) {
192-
if (!this.params || !Utils.shallowEquals(this.params, options.params)) {
192+
// Don't check against the `agent` param - it isn't returned in the ATTACHED message
193+
const requestedParams = Object.assign({}, options.params);
194+
delete requestedParams.agent;
195+
if (Object.keys(requestedParams).length !== 0 && !this.params) {
196+
return true;
197+
}
198+
199+
if (this.params && !Utils.shallowEquals(this.params, requestedParams)) {
193200
return true;
194201
}
195202
}

0 commit comments

Comments
 (0)