actioncable 5.2.8.1 → 6.1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -49
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +3 -546
  5. data/app/assets/javascripts/action_cable.js +574 -0
  6. data/lib/action_cable/channel/base.rb +10 -4
  7. data/lib/action_cable/channel/broadcasting.rb +18 -8
  8. data/lib/action_cable/channel/naming.rb +1 -1
  9. data/lib/action_cable/channel/streams.rb +30 -4
  10. data/lib/action_cable/channel/test_case.rb +310 -0
  11. data/lib/action_cable/channel.rb +1 -0
  12. data/lib/action_cable/connection/authorization.rb +1 -1
  13. data/lib/action_cable/connection/base.rb +13 -7
  14. data/lib/action_cable/connection/message_buffer.rb +1 -4
  15. data/lib/action_cable/connection/stream.rb +4 -2
  16. data/lib/action_cable/connection/subscriptions.rb +2 -5
  17. data/lib/action_cable/connection/test_case.rb +234 -0
  18. data/lib/action_cable/connection/web_socket.rb +1 -3
  19. data/lib/action_cable/connection.rb +1 -0
  20. data/lib/action_cable/engine.rb +1 -1
  21. data/lib/action_cable/gem_version.rb +3 -3
  22. data/lib/action_cable/helpers/action_cable_helper.rb +3 -3
  23. data/lib/action_cable/remote_connections.rb +1 -1
  24. data/lib/action_cable/server/base.rb +9 -4
  25. data/lib/action_cable/server/broadcasting.rb +1 -1
  26. data/lib/action_cable/server/worker.rb +6 -8
  27. data/lib/action_cable/server.rb +0 -1
  28. data/lib/action_cable/subscription_adapter/base.rb +4 -0
  29. data/lib/action_cable/subscription_adapter/postgresql.rb +28 -9
  30. data/lib/action_cable/subscription_adapter/redis.rb +4 -2
  31. data/lib/action_cable/subscription_adapter/test.rb +40 -0
  32. data/lib/action_cable/subscription_adapter.rb +1 -0
  33. data/lib/action_cable/test_case.rb +11 -0
  34. data/lib/action_cable/test_helper.rb +133 -0
  35. data/lib/action_cable.rb +15 -7
  36. data/lib/rails/generators/channel/USAGE +5 -6
  37. data/lib/rails/generators/channel/channel_generator.rb +6 -3
  38. data/lib/rails/generators/channel/templates/{assets → javascript}/channel.js.tt +6 -4
  39. data/lib/rails/generators/channel/templates/javascript/consumer.js.tt +6 -0
  40. data/lib/rails/generators/channel/templates/javascript/index.js.tt +5 -0
  41. data/lib/rails/generators/test_unit/channel_generator.rb +20 -0
  42. data/lib/rails/generators/test_unit/templates/channel_test.rb.tt +8 -0
  43. metadata +36 -11
  44. data/lib/assets/compiled/action_cable.js +0 -601
  45. data/lib/rails/generators/channel/templates/assets/cable.js.tt +0 -13
  46. data/lib/rails/generators/channel/templates/assets/channel.coffee.tt +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c275c495cb08b541718ddfc4e2979d37a3da5afc14c03420d2a5d5a14aa148ba
4
- data.tar.gz: c6ec44589fcb7a7902e664b2473e1ebe67f80b9fe18d84cedbe10d23522f4ac8
3
+ metadata.gz: f96d4c716484dced5cbd93042822c20ded208a7522c488c821811b99b08d4121
4
+ data.tar.gz: ab37ee5ed9640f7687e7c5ccb1366d0be54172e8fb1d289988b50fb9bf497c97
5
5
  SHA512:
6
- metadata.gz: 03cbafd5dadb32fef853347cf46c73ec8900a6f04b7329d7b89efbf6884c0d022b8e3caa0d6898e6e582ab5bf4fbb7e9a72776828199dea52bebce8a2484d62a
7
- data.tar.gz: 9927287ab8b306b8f2cf5c1107555fc86491712111d02bc53c3d266c8f9edb4f9d05cf8693a1cb2746e0e456f6099a78322510704ecc1c128dba9b349f3d3987
6
+ metadata.gz: efffa9698b1fea3b0d2ffe6104a5901b65bc6d50b8e22cf00946265fd4faf091c7ff7c8d3374df12ce6eb0bce8075b371c7e938949064807ca975d30da40ec25
7
+ data.tar.gz: c958a7fde347ad836039c2d28d1ec6c565aea04beac4f9cf022c628980ee60cb3593ce057bc265afd2b0f25efb691cee31a05349882fa59fba7d1a3ec4238f6d
data/CHANGELOG.md CHANGED
@@ -1,134 +1,140 @@
1
- ## Rails 5.2.8.1 (July 12, 2022) ##
1
+ ## Rails 6.1.6.1 (July 12, 2022) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 5.2.8 (May 09, 2022) ##
6
+ ## Rails 6.1.5.1 (April 26, 2022) ##
7
7
 
8
8
  * No changes.
9
9
 
10
10
 
11
- ## Rails 5.2.7.1 (April 26, 2022) ##
11
+ ## Rails 6.1.5 (March 09, 2022) ##
12
12
 
13
- * No changes.
14
-
15
-
16
- ## Rails 5.2.7 (March 10, 2022) ##
13
+ * The Action Cable client now ensures successful channel subscriptions:
17
14
 
18
- * No changes.
15
+ * The client maintains a set of pending subscriptions until either
16
+ the server confirms the subscription or the channel is torn down.
17
+ * Rectifies the race condition where an unsubscribe is rapidly followed
18
+ by a subscribe (on the same channel identifier) and the requests are
19
+ handled out of order by the ActionCable server, thereby ignoring the
20
+ subscribe command.
19
21
 
22
+ *Daniel Spinosa*
20
23
 
21
- ## Rails 5.2.6.3 (March 08, 2022) ##
24
+ * Truncate broadcast logging messages.
22
25
 
23
- * No changes.
26
+ *J Smith*
24
27
 
25
28
 
26
- ## Rails 5.2.6.2 (February 11, 2022) ##
29
+ ## Rails 6.1.4.7 (March 08, 2022) ##
27
30
 
28
31
  * No changes.
29
32
 
30
33
 
31
- ## Rails 5.2.6.1 (February 11, 2022) ##
34
+ ## Rails 6.1.4.6 (February 11, 2022) ##
32
35
 
33
36
  * No changes.
34
37
 
35
38
 
36
- ## Rails 5.2.6 (May 05, 2021) ##
39
+ ## Rails 6.1.4.5 (February 11, 2022) ##
37
40
 
38
41
  * No changes.
39
42
 
40
43
 
41
- ## Rails 5.2.5 (March 26, 2021) ##
44
+ ## Rails 6.1.4.4 (December 15, 2021) ##
42
45
 
43
46
  * No changes.
44
47
 
45
48
 
46
- ## Rails 5.2.4.6 (May 05, 2021) ##
49
+ ## Rails 6.1.4.3 (December 14, 2021) ##
47
50
 
48
51
  * No changes.
49
52
 
50
53
 
51
- ## Rails 5.2.4.5 (February 10, 2021) ##
54
+ ## Rails 6.1.4.2 (December 14, 2021) ##
52
55
 
53
56
  * No changes.
54
57
 
55
58
 
56
- ## Rails 5.2.4.4 (September 09, 2020) ##
59
+ ## Rails 6.1.4.1 (August 19, 2021) ##
57
60
 
58
61
  * No changes.
59
62
 
60
63
 
61
- ## Rails 5.2.4.3 (May 18, 2020) ##
64
+ ## Rails 6.1.4 (June 24, 2021) ##
62
65
 
63
- * No changes.
66
+ * Fix `ArgumentError` with ruby 3.0 on `RemoteConnection#disconnect`.
64
67
 
68
+ *Vladislav*
65
69
 
66
- ## Rails 5.2.4.2 (March 19, 2020) ##
67
70
 
68
- * No changes.
69
-
70
-
71
- ## Rails 5.2.4.1 (December 18, 2019) ##
71
+ ## Rails 6.1.3.2 (May 05, 2021) ##
72
72
 
73
73
  * No changes.
74
74
 
75
75
 
76
- ## Rails 5.2.4 (November 27, 2019) ##
76
+ ## Rails 6.1.3.1 (March 26, 2021) ##
77
77
 
78
78
  * No changes.
79
79
 
80
80
 
81
- ## Rails 5.2.3 (March 27, 2019) ##
81
+ ## Rails 6.1.3 (February 17, 2021) ##
82
82
 
83
83
  * No changes.
84
84
 
85
85
 
86
- ## Rails 5.2.2.1 (March 11, 2019) ##
86
+ ## Rails 6.1.2.1 (February 10, 2021) ##
87
87
 
88
88
  * No changes.
89
89
 
90
90
 
91
- ## Rails 5.2.2 (December 04, 2018) ##
91
+ ## Rails 6.1.2 (February 09, 2021) ##
92
92
 
93
93
  * No changes.
94
94
 
95
95
 
96
- ## Rails 5.2.1.1 (November 27, 2018) ##
96
+ ## Rails 6.1.1 (January 07, 2021) ##
97
97
 
98
98
  * No changes.
99
99
 
100
100
 
101
- ## Rails 5.2.1 (August 07, 2018) ##
102
-
103
- * No changes.
101
+ ## Rails 6.1.0 (December 09, 2020) ##
104
102
 
103
+ * `ActionCable::Connection::Base` now allows intercepting unhandled exceptions
104
+ with `rescue_from` before they are logged, which is useful for error reporting
105
+ tools and other integrations.
105
106
 
106
- ## Rails 5.2.0 (April 09, 2018) ##
107
+ *Justin Talbott*
107
108
 
108
- * Removed deprecated evented redis adapter.
109
+ * Add `ActionCable::Channel#stream_or_reject_for` to stream if record is present, otherwise reject the connection
109
110
 
110
- *Rafael Mendonça França*
111
+ *Atul Bhosale*
111
112
 
112
- * Support redis-rb 4.0.
113
+ * Add `ActionCable::Channel#stop_stream_from` and `#stop_stream_for` to unsubscribe from a specific stream.
113
114
 
114
- *Jeremy Daer*
115
+ *Zhang Kang*
115
116
 
116
- * Hash long stream identifiers when using PostgreSQL adapter.
117
+ * Add PostgreSQL subscription connection identificator.
117
118
 
118
- PostgreSQL has a limit on identifiers length (63 chars, [docs](https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)).
119
- Provided fix minifies identifiers longer than 63 chars by hashing them with SHA1.
119
+ Now you can distinguish Action Cable PostgreSQL subscription connections among others.
120
+ Also, you can set custom `id` in `cable.yml` configuration.
120
121
 
121
- Fixes #28751.
122
+ ```sql
123
+ SELECT application_name FROM pg_stat_activity;
124
+ /*
125
+ application_name
126
+ ------------------------
127
+ psql
128
+ ActionCable-PID-42
129
+ (2 rows)
130
+ */
131
+ ```
122
132
 
123
- *Vladimir Dementyev*
133
+ *Sergey Ponomarev*
124
134
 
125
- * Action Cable's `redis` adapter allows for other common redis-rb options (`host`, `port`, `db`, `password`) in cable.yml.
135
+ * Subscription confirmations and rejections are now logged at the `DEBUG` level instead of `INFO`.
126
136
 
127
- Previously, it accepts only a [redis:// url](https://www.iana.org/assignments/uri-schemes/prov/redis) as an option.
128
- While we can add all of these options to the `url` itself, it is not explicitly documented. This alternative setup
129
- is shown as the first example in the [Redis rubygem](https://github.com/redis/redis-rb#getting-started), which
130
- makes this set of options as sensible as using just the `url`.
137
+ *DHH*
131
138
 
132
- *Marc Rendl Ignacio*
133
139
 
134
- Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/actioncable/CHANGELOG.md) for previous changes.
140
+ Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actioncable/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015-2018 Basecamp, LLC
1
+ Copyright (c) 2015-2022 Basecamp, 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