@rails/actioncable 7.0.2 → 7.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -166,7 +166,7 @@
166
166
  if (!allowReconnect) {
167
167
  this.monitor.stop();
168
168
  }
169
- if (this.isActive()) {
169
+ if (this.isOpen()) {
170
170
  return this.webSocket.close();
171
171
  }
172
172
  }
@@ -172,7 +172,7 @@ class Connection {
172
172
  if (!allowReconnect) {
173
173
  this.monitor.stop();
174
174
  }
175
- if (this.isActive()) {
175
+ if (this.isOpen()) {
176
176
  return this.webSocket.close();
177
177
  }
178
178
  }
@@ -166,7 +166,7 @@
166
166
  if (!allowReconnect) {
167
167
  this.monitor.stop();
168
168
  }
169
- if (this.isActive()) {
169
+ if (this.isOpen()) {
170
170
  return this.webSocket.close();
171
171
  }
172
172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/actioncable",
3
- "version": "7.0.2",
3
+ "version": "7.0.4",
4
4
  "description": "WebSocket framework for Ruby on Rails.",
5
5
  "module": "app/assets/javascripts/actioncable.esm.js",
6
6
  "main": "app/assets/javascripts/actioncable.js",
package/src/connection.js CHANGED
@@ -44,7 +44,8 @@ class Connection {
44
44
 
45
45
  close({allowReconnect} = {allowReconnect: true}) {
46
46
  if (!allowReconnect) { this.monitor.stop() }
47
- if (this.isActive()) {
47
+ // Avoid closing websockets in a "connecting" state due to Safari 15.1+ bug. See: https://github.com/rails/rails/issues/43835#issuecomment-1002288478
48
+ if (this.isOpen()) {
48
49
  return this.webSocket.close()
49
50
  }
50
51
  }