Skip to content

Commit 72c388c

Browse files
committed
Fix channel leave on unjoined channels. Closes #5779
1 parent 28203dd commit 72c388c

File tree

8 files changed

+13
-10
lines changed

8 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ future styling).
4848

4949
## 1.7.12
5050

51+
### JavaScript Client Bug Fixes
52+
* Fix all unjoined channels from being removed from the socket when channel leave is called on any single unjoined channel instance
53+
5154
### Enhancements
5255
* [phx.gen.auth] Add enhanced session fixation protection.
5356
For applications whichs previously used `phx.gen.auth`, the following line can be added to the `renew_session` function in the auth module:

assets/js/phoenix/socket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ export default class Socket {
543543
*/
544544
remove(channel){
545545
this.off(channel.stateChangeRefs)
546-
this.channels = this.channels.filter(c => c.joinRef() !== channel.joinRef())
546+
this.channels = this.channels.filter(c => c !== channel)
547547
}
548548

549549
/**

priv/static/phoenix.cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/phoenix.cjs.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/phoenix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ var Phoenix = (() => {
14611461
*/
14621462
remove(channel) {
14631463
this.off(channel.stateChangeRefs);
1464-
this.channels = this.channels.filter((c) => c.joinRef() !== channel.joinRef());
1464+
this.channels = this.channels.filter((c) => c !== channel);
14651465
}
14661466
/**
14671467
* Removes `onOpen`, `onClose`, `onError,` and `onMessage` registrations.

priv/static/phoenix.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/phoenix.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ var Socket = class {
14321432
*/
14331433
remove(channel) {
14341434
this.off(channel.stateChangeRefs);
1435-
this.channels = this.channels.filter((c) => c.joinRef() !== channel.joinRef());
1435+
this.channels = this.channels.filter((c) => c !== channel);
14361436
}
14371437
/**
14381438
* Removes `onOpen`, `onClose`, `onError,` and `onMessage` registrations.

priv/static/phoenix.mjs.map

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)