actioncable 6.1.7.9 → 7.2.2.1

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -160
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +5 -5
  5. data/app/assets/javascripts/action_cable.js +239 -302
  6. data/app/assets/javascripts/actioncable.esm.js +512 -0
  7. data/app/assets/javascripts/actioncable.js +510 -0
  8. data/lib/action_cable/channel/base.rb +114 -90
  9. data/lib/action_cable/channel/broadcasting.rb +25 -16
  10. data/lib/action_cable/channel/callbacks.rb +39 -0
  11. data/lib/action_cable/channel/naming.rb +10 -7
  12. data/lib/action_cable/channel/periodic_timers.rb +7 -7
  13. data/lib/action_cable/channel/streams.rb +81 -68
  14. data/lib/action_cable/channel/test_case.rb +133 -87
  15. data/lib/action_cable/connection/authorization.rb +4 -1
  16. data/lib/action_cable/connection/base.rb +71 -43
  17. data/lib/action_cable/connection/callbacks.rb +57 -0
  18. data/lib/action_cable/connection/client_socket.rb +3 -1
  19. data/lib/action_cable/connection/identification.rb +10 -6
  20. data/lib/action_cable/connection/internal_channel.rb +7 -2
  21. data/lib/action_cable/connection/message_buffer.rb +4 -1
  22. data/lib/action_cable/connection/stream.rb +2 -2
  23. data/lib/action_cable/connection/stream_event_loop.rb +4 -4
  24. data/lib/action_cable/connection/subscriptions.rb +8 -3
  25. data/lib/action_cable/connection/tagged_logger_proxy.rb +14 -9
  26. data/lib/action_cable/connection/test_case.rb +67 -55
  27. data/lib/action_cable/connection/web_socket.rb +11 -7
  28. data/lib/action_cable/deprecator.rb +9 -0
  29. data/lib/action_cable/engine.rb +28 -9
  30. data/lib/action_cable/gem_version.rb +7 -5
  31. data/lib/action_cable/helpers/action_cable_helper.rb +21 -18
  32. data/lib/action_cable/remote_connections.rb +25 -13
  33. data/lib/action_cable/server/base.rb +29 -14
  34. data/lib/action_cable/server/broadcasting.rb +24 -16
  35. data/lib/action_cable/server/configuration.rb +28 -14
  36. data/lib/action_cable/server/connections.rb +13 -5
  37. data/lib/action_cable/server/worker/active_record_connection_management.rb +4 -2
  38. data/lib/action_cable/server/worker.rb +7 -7
  39. data/lib/action_cable/subscription_adapter/async.rb +1 -1
  40. data/lib/action_cable/subscription_adapter/base.rb +2 -0
  41. data/lib/action_cable/subscription_adapter/channel_prefix.rb +2 -0
  42. data/lib/action_cable/subscription_adapter/inline.rb +2 -0
  43. data/lib/action_cable/subscription_adapter/postgresql.rb +6 -5
  44. data/lib/action_cable/subscription_adapter/redis.rb +101 -25
  45. data/lib/action_cable/subscription_adapter/subscriber_map.rb +2 -0
  46. data/lib/action_cable/subscription_adapter/test.rb +7 -6
  47. data/lib/action_cable/test_case.rb +2 -0
  48. data/lib/action_cable/test_helper.rb +89 -59
  49. data/lib/action_cable/version.rb +3 -1
  50. data/lib/action_cable.rb +30 -12
  51. data/lib/rails/generators/channel/USAGE +14 -8
  52. data/lib/rails/generators/channel/channel_generator.rb +95 -20
  53. data/lib/rails/generators/channel/templates/javascript/index.js.tt +1 -5
  54. data/lib/rails/generators/test_unit/channel_generator.rb +2 -0
  55. metadata +29 -15
  56. data/lib/action_cable/channel.rb +0 -17
  57. data/lib/action_cable/connection.rb +0 -22
  58. data/lib/action_cable/server.rb +0 -16
  59. data/lib/action_cable/subscription_adapter.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a6a93e1ee54ee65761b4b9eb8aa6ece143b5753f33da5db0168b93149a9b56a
4
- data.tar.gz: c218a4c5c6b2b9bcadc335cb8afe462da4f98c008ec7a0a20e264856ae11b882
3
+ metadata.gz: 720238323d1411f0913bcc9b65ac89d955c4fc4e708bbab5b5dd1c0c47c4cf00
4
+ data.tar.gz: 10a5cd05102adeda05b151a39c40183bc55c2c55c2c63dca5a13d642fcf49f58
5
5
  SHA512:
6
- metadata.gz: ad3d9b39de6198b77a07d7704dfb0ab2c140772876282d5c30f7c5b7fdb685aed5717e88b05f14c358ff3eff24d7730ba1bef5346d8cea25131f3f42a02fa26c
7
- data.tar.gz: cab315afc75ce6916b382f74aec78ee24a8763931a2bb74ca927c050708d767c06e2be32e990132e5bb96e0a0dee0efadfc89a5c6b1841f185e47a0df95ef5b8
6
+ metadata.gz: '0639a73b1efc8078fe167814911d5694e76781f618ac7fe5bb34ae8448ab495b60f598a76c6a0e8d7c9f45d9674d19564ad14eaae0ccaaf1f75b441d1318d7c8'
7
+ data.tar.gz: 4988a92b2c683bc86c28d60be1d2f92d1efe36bc5d33f814da55ac7328af60597fb0313321aa663b6d5632ecd565661725d12bf1238fa48a153b18d538e6e08e
data/CHANGELOG.md CHANGED
@@ -1,195 +1,68 @@
1
- ## Rails 6.1.7.9 (October 15, 2024) ##
1
+ ## Rails 7.2.2.1 (December 10, 2024) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 6.1.7.8 (June 04, 2024) ##
6
+ ## Rails 7.2.2 (October 30, 2024) ##
7
7
 
8
8
  * No changes.
9
9
 
10
10
 
11
- ## Rails 6.1.7.7 (February 21, 2024) ##
11
+ ## Rails 7.2.1.2 (October 23, 2024) ##
12
12
 
13
13
  * No changes.
14
14
 
15
15
 
16
- ## Rails 6.1.7.6 (August 22, 2023) ##
16
+ ## Rails 7.2.1.1 (October 15, 2024) ##
17
17
 
18
18
  * No changes.
19
19
 
20
20
 
21
- ## Rails 6.1.7.5 (August 22, 2023) ##
21
+ ## Rails 7.2.1 (August 22, 2024) ##
22
22
 
23
23
  * No changes.
24
24
 
25
25
 
26
- ## Rails 6.1.7.4 (June 26, 2023) ##
27
-
28
- * No changes.
29
-
30
-
31
- ## Rails 6.1.7.3 (March 13, 2023) ##
32
-
33
- * No changes.
34
-
35
-
36
- ## Rails 6.1.7.2 (January 24, 2023) ##
37
-
38
- * No changes.
39
-
40
-
41
- ## Rails 6.1.7.1 (January 17, 2023) ##
42
-
43
- * No changes.
44
-
45
-
46
- ## Rails 6.1.7 (September 09, 2022) ##
47
-
48
- * No changes.
49
-
50
-
51
- ## Rails 6.1.6.1 (July 12, 2022) ##
52
-
53
- * No changes.
54
-
55
-
56
- ## Rails 6.1.6 (May 09, 2022) ##
57
-
58
- * No changes.
59
-
60
-
61
- ## Rails 6.1.5.1 (April 26, 2022) ##
62
-
63
- * No changes.
64
-
65
-
66
- ## Rails 6.1.5 (March 09, 2022) ##
67
-
68
- * The Action Cable client now ensures successful channel subscriptions:
69
-
70
- * The client maintains a set of pending subscriptions until either
71
- the server confirms the subscription or the channel is torn down.
72
- * Rectifies the race condition where an unsubscribe is rapidly followed
73
- by a subscribe (on the same channel identifier) and the requests are
74
- handled out of order by the ActionCable server, thereby ignoring the
75
- subscribe command.
76
-
77
- *Daniel Spinosa*
78
-
79
- * Truncate broadcast logging messages.
80
-
81
- *J Smith*
82
-
83
-
84
- ## Rails 6.1.4.7 (March 08, 2022) ##
85
-
86
- * No changes.
87
-
88
-
89
- ## Rails 6.1.4.6 (February 11, 2022) ##
90
-
91
- * No changes.
92
-
93
-
94
- ## Rails 6.1.4.5 (February 11, 2022) ##
95
-
96
- * No changes.
26
+ ## Rails 7.2.0 (August 09, 2024) ##
97
27
 
28
+ * Bring `ActionCable::Connection::TestCookieJar` in alignment with `ActionDispatch::Cookies::CookieJar` in regards to setting the cookie value.
98
29
 
99
- ## Rails 6.1.4.4 (December 15, 2021) ##
30
+ Before:
100
31
 
101
- * No changes.
102
-
103
-
104
- ## Rails 6.1.4.3 (December 14, 2021) ##
105
-
106
- * No changes.
107
-
108
-
109
- ## Rails 6.1.4.2 (December 14, 2021) ##
110
-
111
- * No changes.
112
-
113
-
114
- ## Rails 6.1.4.1 (August 19, 2021) ##
115
-
116
- * No changes.
117
-
118
-
119
- ## Rails 6.1.4 (June 24, 2021) ##
120
-
121
- * Fix `ArgumentError` with ruby 3.0 on `RemoteConnection#disconnect`.
122
-
123
- *Vladislav*
124
-
125
-
126
- ## Rails 6.1.3.2 (May 05, 2021) ##
127
-
128
- * No changes.
129
-
130
-
131
- ## Rails 6.1.3.1 (March 26, 2021) ##
132
-
133
- * No changes.
134
-
135
-
136
- ## Rails 6.1.3 (February 17, 2021) ##
137
-
138
- * No changes.
139
-
140
-
141
- ## Rails 6.1.2.1 (February 10, 2021) ##
142
-
143
- * No changes.
144
-
145
-
146
- ## Rails 6.1.2 (February 09, 2021) ##
147
-
148
- * No changes.
149
-
150
-
151
- ## Rails 6.1.1 (January 07, 2021) ##
152
-
153
- * No changes.
154
-
155
-
156
- ## Rails 6.1.0 (December 09, 2020) ##
32
+ ```ruby
33
+ cookies[:foo] = { value: "bar" }
34
+ puts cookies[:foo] # => { value: "bar" }
35
+ ```
157
36
 
158
- * `ActionCable::Connection::Base` now allows intercepting unhandled exceptions
159
- with `rescue_from` before they are logged, which is useful for error reporting
160
- tools and other integrations.
37
+ After:
161
38
 
162
- *Justin Talbott*
39
+ ```ruby
40
+ cookies[:foo] = { value: "bar" }
41
+ puts cookies[:foo] # => "bar"
42
+ ```
163
43
 
164
- * Add `ActionCable::Channel#stream_or_reject_for` to stream if record is present, otherwise reject the connection
44
+ *Justin Ko*
165
45
 
166
- *Atul Bhosale*
46
+ * Record ping on every Action Cable message.
167
47
 
168
- * Add `ActionCable::Channel#stop_stream_from` and `#stop_stream_for` to unsubscribe from a specific stream.
48
+ Previously only `ping` and `welcome` message types were keeping the connection active.
49
+ Now every Action Cable message updates the `pingedAt` value, preventing the connection
50
+ from being marked as stale.
169
51
 
170
- *Zhang Kang*
52
+ *yauhenininjia*
171
53
 
172
- * Add PostgreSQL subscription connection identificator.
54
+ * Add two new assertion methods for Action Cable test cases: `assert_has_no_stream`
55
+ and `assert_has_no_stream_for`.
173
56
 
174
- Now you can distinguish Action Cable PostgreSQL subscription connections among others.
175
- Also, you can set custom `id` in `cable.yml` configuration.
57
+ These methods can be used to assert that a stream has been stopped, e.g. via
58
+ `stop_stream` or `stop_stream_for`. They complement the already existing
59
+ `assert_has_stream` and `assert_has_stream_for` methods.
176
60
 
177
- ```sql
178
- SELECT application_name FROM pg_stat_activity;
179
- /*
180
- application_name
181
- ------------------------
182
- psql
183
- ActionCable-PID-42
184
- (2 rows)
185
- */
61
+ ```ruby
62
+ assert_has_no_stream "messages"
63
+ assert_has_no_stream_for User.find(42)
186
64
  ```
187
65
 
188
- *Sergey Ponomarev*
189
-
190
- * Subscription confirmations and rejections are now logged at the `DEBUG` level instead of `INFO`.
191
-
192
- *DHH*
193
-
66
+ *Sebastian Pöll*, *Junichi Sato*
194
67
 
195
- Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actioncable/CHANGELOG.md) for previous changes.
68
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/actioncable/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015-2022 Basecamp, LLC
1
+ Copyright (c) 37signals LLC
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # Action Cable – Integrated WebSockets for Rails
1
+ # Action Cable – Integrated WebSockets for \Rails
2
2
 
3
- Action Cable seamlessly integrates WebSockets with the rest of your Rails application.
3
+ Action Cable seamlessly integrates WebSockets with the rest of your \Rails application.
4
4
  It allows for real-time features to be written in Ruby in the same style
5
- and form as the rest of your Rails application, while still being performant
5
+ and form as the rest of your \Rails application, while still being performant
6
6
  and scalable. It's a full-stack offering that provides both a client-side
7
7
  JavaScript framework and a server-side Ruby framework. You have access to your full
8
8
  domain model written with Active Record or your ORM of choice.
9
9
 
10
- You can read more about Action Cable in the [Action Cable Overview](https://edgeguides.rubyonrails.org/action_cable_overview.html) guide.
10
+ You can read more about Action Cable in the [Action Cable Overview](https://guides.rubyonrails.org/action_cable_overview.html) guide.
11
11
 
12
12
  ## Support
13
13
 
@@ -15,7 +15,7 @@ API documentation is at:
15
15
 
16
16
  * https://api.rubyonrails.org
17
17
 
18
- Bug reports for the Ruby on Rails project can be filed here:
18
+ Bug reports for the Ruby on \Rails project can be filed here:
19
19
 
20
20
  * https://github.com/rails/rails/issues
21
21