Skip to content

Commit

Permalink
fix: don't compare agent channel param when determining whether cha…
Browse files Browse the repository at this point in the history
…nnel options require reattach
  • Loading branch information
Owen Pearson authored and Owen Pearson committed Nov 1, 2023
1 parent e3e6781 commit 16d620c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/common/lib/client/realtimechannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,14 @@ class RealtimeChannel extends Channel {
return false;
}
if (options?.params) {
if (!this.params || !Utils.shallowEquals(this.params, options.params)) {
// Don't check against the `agent` param - it isn't returned in the ATTACHED message
const requestedParams = Object.assign({}, options.params);
delete requestedParams.agent;
if (Object.keys(requestedParams).length !== 0 && !this.params) {
return true;
}

if (this.params && !Utils.shallowEquals(this.params, requestedParams)) {
return true;
}
}
Expand Down

0 comments on commit 16d620c

Please sign in to comment.