actioncable 7.2.1.1 → 8.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -46
- data/lib/action_cable/channel/base.rb +2 -3
- data/lib/action_cable/connection/identification.rb +0 -2
- data/lib/action_cable/gem_version.rb +4 -4
- data/lib/action_cable/remote_connections.rb +32 -33
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbdb5ca677b4c8917a8b4e51154f289c9a87ddc3fd89bafec7847a357bdd7755
|
4
|
+
data.tar.gz: 15ebe0effa213d8743c8eeebd0e1b17a2f1ef94fd8ae98fb882ef21272a38844
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7949cf91c9acb42885623c18191a6ace4762e98c7a64220bd7396ffdaecbf61915354b2a409003a323ab7ce00fc6fd233701f3ce7c5a654c61cceb0e862efc5
|
7
|
+
data.tar.gz: e9ee9966a4ea211757308cd63a52768997eeaef9fdee08cf9f6ec24ef612a3ff1ef8b25ed4d11da4450adda90c071adf3b1f8d895d277f2a69874e3345ce0e01
|
data/CHANGELOG.md
CHANGED
@@ -1,53 +1,12 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 8.0.0.rc1 (October 19, 2024) ##
|
2
2
|
|
3
3
|
* No changes.
|
4
4
|
|
5
5
|
|
6
|
-
## Rails
|
6
|
+
## Rails 8.0.0.beta1 (September 26, 2024) ##
|
7
7
|
|
8
|
-
*
|
9
|
-
|
10
|
-
|
11
|
-
## Rails 7.2.0 (August 09, 2024) ##
|
12
|
-
|
13
|
-
* Bring `ActionCable::Connection::TestCookieJar` in alignment with `ActionDispatch::Cookies::CookieJar` in regards to setting the cookie value.
|
14
|
-
|
15
|
-
Before:
|
16
|
-
|
17
|
-
```ruby
|
18
|
-
cookies[:foo] = { value: "bar" }
|
19
|
-
puts cookies[:foo] # => { value: "bar" }
|
20
|
-
```
|
21
|
-
|
22
|
-
After:
|
23
|
-
|
24
|
-
```ruby
|
25
|
-
cookies[:foo] = { value: "bar" }
|
26
|
-
puts cookies[:foo] # => "bar"
|
27
|
-
```
|
28
|
-
|
29
|
-
*Justin Ko*
|
30
|
-
|
31
|
-
* Record ping on every Action Cable message.
|
32
|
-
|
33
|
-
Previously only `ping` and `welcome` message types were keeping the connection active.
|
34
|
-
Now every Action Cable message updates the `pingedAt` value, preventing the connection
|
35
|
-
from being marked as stale.
|
36
|
-
|
37
|
-
*yauhenininjia*
|
38
|
-
|
39
|
-
* Add two new assertion methods for Action Cable test cases: `assert_has_no_stream`
|
40
|
-
and `assert_has_no_stream_for`.
|
41
|
-
|
42
|
-
These methods can be used to assert that a stream has been stopped, e.g. via
|
43
|
-
`stop_stream` or `stop_stream_for`. They complement the already existing
|
44
|
-
`assert_has_stream` and `assert_has_stream_for` methods.
|
45
|
-
|
46
|
-
```ruby
|
47
|
-
assert_has_no_stream "messages"
|
48
|
-
assert_has_no_stream_for User.find(42)
|
49
|
-
```
|
8
|
+
* Add an `identifier` to the event payload for the ActiveSupport::Notification `transmit_subscription_confirmation.action_cable` and `transmit_subscription_rejection.action_cable`.
|
50
9
|
|
51
|
-
*
|
10
|
+
*Keith Schacht*
|
52
11
|
|
53
|
-
Please check [7-
|
12
|
+
Please check [7-2-stable](https://github.com/rails/rails/blob/7-2-stable/actioncable/CHANGELOG.md) for previous changes.
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
# :markup: markdown
|
4
4
|
|
5
|
-
require "set"
|
6
5
|
require "active_support/rescuable"
|
7
6
|
require "active_support/parameter_filter"
|
8
7
|
|
@@ -309,7 +308,7 @@ module ActionCable
|
|
309
308
|
unless subscription_confirmation_sent?
|
310
309
|
logger.debug "#{self.class.name} is transmitting the subscription confirmation"
|
311
310
|
|
312
|
-
ActiveSupport::Notifications.instrument("transmit_subscription_confirmation.action_cable", channel_class: self.class.name) do
|
311
|
+
ActiveSupport::Notifications.instrument("transmit_subscription_confirmation.action_cable", channel_class: self.class.name, identifier: @identifier) do
|
313
312
|
connection.transmit identifier: @identifier, type: ActionCable::INTERNAL[:message_types][:confirmation]
|
314
313
|
@subscription_confirmation_sent = true
|
315
314
|
end
|
@@ -324,7 +323,7 @@ module ActionCable
|
|
324
323
|
def transmit_subscription_rejection
|
325
324
|
logger.debug "#{self.class.name} is transmitting the subscription rejection"
|
326
325
|
|
327
|
-
ActiveSupport::Notifications.instrument("transmit_subscription_rejection.action_cable", channel_class: self.class.name) do
|
326
|
+
ActiveSupport::Notifications.instrument("transmit_subscription_rejection.action_cable", channel_class: self.class.name, identifier: @identifier) do
|
328
327
|
connection.transmit identifier: @identifier, type: ActionCable::INTERNAL[:message_types][:rejection]
|
329
328
|
end
|
330
329
|
end
|
@@ -39,45 +39,44 @@ module ActionCable
|
|
39
39
|
RemoteConnection.new(server, identifier)
|
40
40
|
end
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
class
|
49
|
-
class InvalidIdentifiersError < StandardError; end
|
42
|
+
# # Action Cable Remote Connection
|
43
|
+
#
|
44
|
+
# Represents a single remote connection found via
|
45
|
+
# `ActionCable.server.remote_connections.where(*)`. Exists solely for the
|
46
|
+
# purpose of calling #disconnect on that connection.
|
47
|
+
class RemoteConnection
|
48
|
+
class InvalidIdentifiersError < StandardError; end
|
50
49
|
|
51
|
-
|
50
|
+
include Connection::Identification, Connection::InternalChannel
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
def initialize(server, ids)
|
53
|
+
@server = server
|
54
|
+
set_identifier_instance_vars(ids)
|
55
|
+
end
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
# Uses the internal channel to disconnect the connection.
|
58
|
+
def disconnect(reconnect: true)
|
59
|
+
server.broadcast internal_channel, { type: "disconnect", reconnect: reconnect }
|
60
|
+
end
|
62
61
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
# Returns all the identifiers that were applied to this connection.
|
63
|
+
redefine_method :identifiers do
|
64
|
+
server.connection_identifiers
|
65
|
+
end
|
67
66
|
|
68
|
-
|
69
|
-
|
67
|
+
protected
|
68
|
+
attr_reader :server
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
70
|
+
private
|
71
|
+
def set_identifier_instance_vars(ids)
|
72
|
+
raise InvalidIdentifiersError unless valid_identifiers?(ids)
|
73
|
+
ids.each { |k, v| instance_variable_set("@#{k}", v) }
|
74
|
+
end
|
76
75
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
76
|
+
def valid_identifiers?(ids)
|
77
|
+
keys = ids.keys
|
78
|
+
identifiers.all? { |id| keys.include?(id) }
|
79
|
+
end
|
80
|
+
end
|
82
81
|
end
|
83
82
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actioncable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pratik Naik
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-10-
|
12
|
+
date: 2024-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 8.0.0.rc1
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 8.0.0.rc1
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: actionpack
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - '='
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 8.0.0.rc1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - '='
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 8.0.0.rc1
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: nio4r
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,10 +154,10 @@ licenses:
|
|
154
154
|
- MIT
|
155
155
|
metadata:
|
156
156
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
157
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
158
|
-
documentation_uri: https://api.rubyonrails.org/
|
157
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.0.0.rc1/actioncable/CHANGELOG.md
|
158
|
+
documentation_uri: https://api.rubyonrails.org/v8.0.0.rc1/
|
159
159
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
160
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
160
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.0.0.rc1/actioncable
|
161
161
|
rubygems_mfa_required: 'true'
|
162
162
|
post_install_message:
|
163
163
|
rdoc_options: []
|
@@ -167,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
167
|
requirements:
|
168
168
|
- - ">="
|
169
169
|
- !ruby/object:Gem::Version
|
170
|
-
version: 3.
|
170
|
+
version: 3.2.0
|
171
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
172
|
requirements:
|
173
173
|
- - ">="
|