actioncable 5.2.6.3 → 6.1.5

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