actioncable 5.2.7.1 → 6.1.4.6

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