Commit Graph

211 Commits

Author SHA1 Message Date
Javan Makhmali
82a1bf268d Establish WebSocket connection when first subscription is created. Fixes #24026
* More intention revealing than connecting on the first call to Connection#send
* Fixes that calls to Connection#send would attempt to open a connection when the WebSocket's state is CONNECTING
2016-03-03 17:59:12 -05:00
Matthew Draper
bbba0649f5 Merge pull request #23992 from matthewd/em-option
Support faye-websocket + EventMachine as an option
2016-03-04 05:31:48 +10:30
Daniel Rhodes
78b0ac3259 ConnectionMonitor is once again notified of disconnect 2016-03-03 15:00:11 +01:00
Jeremy Daer
4f21ac7e9c Fix CHANGELOG spacing [ci skip] 2016-03-02 11:37:19 -07:00
Jon Moss
45635098ac Accept JSON with no backslashes/escaping
Fixes #22675

Allow channel identifiers and also data with no backslahes/escaping to be accepted by
the subscription storer.
2016-03-02 09:01:43 -05:00
Matthew Draper
fc1b32f8d1 Merge pull request #23976 from danielrhodes/enhancement/ac-ping-to-message-type
ActionCable: Add a "welcome" and "ping" message type
2016-03-02 19:17:57 +10:30
Matthew Draper
a373be9da4 Support faye-websocket + EventMachine as an option 2016-03-02 12:17:15 +10:30
Arthur Nogueira Neves
15c308582f Merge pull request #23932 from arthurnn/arthurnn/remove_load_paths
Remove load_paths file
2016-03-01 16:10:09 -05:00
Rafael França
998d21a961 Merge pull request #23935 from y-yagi/convert_cable_coffee_to_javascript
convert cable.coffee to cable.js
2016-03-01 15:19:52 -03:00
Matthew Draper
185c93eb0c Use AS::Executor / AS::Reloader to support reloading in ActionCable 2016-03-02 02:14:20 +10:30
Daniel Rhodes
53e163dc3f Make ping into a message type
This change makes ping into a message type, which
makes the whole protocol a lot more consistent.

Also fixes hacks on the client side to make this all
work.
2016-03-01 02:48:15 +01:00
Bouke van der Bijl
242abf8850 Remove inconsistency in the Action Cable README [ci skip] 2016-02-29 20:25:30 -05:00
Daniel Rhodes
f51cb7eef5 Added welcome message type and fix test hacks 2016-03-01 01:38:35 +01:00
David Heinemeier Hansson
dabf47938f Merge pull request #23811 from iamvery/string-channel
Ensure actioncable behaves as expected with non-string queues
2016-02-28 14:58:28 +01:00
yuuji.yaginuma
861e7d43e3 convert cable.coffee to cable.js
In order to eliminate the dependecy of CoffeeScript.
2016-02-28 15:07:03 +09:00
Hayley Anderson
b425a86591 Add small Action Cable documentation fixes
* Fix typos/grammar errors
* Make capitalization/naming consistent
2016-02-27 13:53:31 -05:00
Arthur Neves
2abcdfd978 Remove load_paths file 2016-02-27 13:03:57 -05:00
Jeremy Daer
e0a225a3d5 Merge pull request #23916 from lifo/same-redis-connection-for-subscription-and-broadcast
Always use redis_connector to create redis connections
2016-02-26 11:45:17 -07:00
Pratik Naik
4056a9e815 Use redis_connector to create redis connections for both subscriptions and broadcasts 2016-02-26 12:31:14 -06:00
Matthew Draper
f1a76bd429 The async.callback call should live with the hijack
If we're deferring one, we should defer the other too.
2016-02-26 13:58:54 +10:30
Matthew Draper
50e4433b05 Merge pull request #23843 from maclover7/fix-23471
Only hijack Rack socket when first needed
2016-02-25 13:58:31 +10:30
Jon Moss
a536cc8f1e Only hijack Rack socket when first needed
Fixes #23471
2016-02-24 21:48:59 -05:00
Jon Moss
1afd414488 Only open Action Cable connection if data is being sent 2016-02-24 20:37:52 -05:00
Jon Moss
8b69f1eeba Enable Action Cable routes by default
This also marks Action Cable routes as internal to Rails.
2016-02-24 19:05:03 -05:00
Jay Hayes
bbe59375d0 Update changelog 2016-02-24 17:22:26 -06:00
Jay Hayes
3ecab07800 Ensure server broadcasts are to string queue names
Similar to the channel streaming side, these values must be strings for
ActionCable to behave as expected. The conversion will allow users to
send string-convertible values and get the expected behavior.
2016-02-24 17:22:06 -06:00
Jay Hayes
046e32656e Convert stream broadcasting to a string
ActionCable does some things behind the scenes that expects these
"broadcasting"s or "channel"s to be strings. However it's not
immediately obvious that the value must be a string. So adding this
conversion ensures things work as expected.
2016-02-24 12:43:23 -06:00
Jay Hayes
b426247250 whitespace 2016-02-24 12:42:55 -06:00
claudiob
7d46371d89 Add Ruby formatting to CHANGELOG entry
[ci skip]
2016-02-24 08:49:33 -08:00
eileencodes
dbfa8fdfc2 Preparing for 5.0.0.beta3 release
Adds changelog headers for beta3 release
2016-02-24 11:14:40 -05:00
eileencodes
826420b5fc Prep release for Rails 5 beta3 2016-02-24 10:27:02 -05:00
Rafael França
3adc35aefa Merge pull request #23789 from wisetara/wisetara/deprecate-args-ActiveSupport__TestCase#assert_nothing_raised-for-pr
Wisetara/deprecate args active support  test case#assert nothing raised for pr
2016-02-23 13:59:49 -03:00
David Heinemeier Hansson
b2c2d32908 Merge pull request #23813 from lifo/faye-websocket
Improve Action Cable reconnection reliability
2016-02-23 16:41:26 +01:00
Javan Makhmali
c889408e0d Fix isAlive condition and add more logging 2016-02-23 09:37:50 -06:00
Javan Makhmali
dde833816a ActionCable.log 2016-02-23 09:37:50 -06:00
Javan Makhmali
1a90ff9a4d Uninstall event handlers when replacing WebSocket instance
Ensures we don't get "onclose" events from a previous WebSocket that was in the "closing" state
2016-02-23 09:37:49 -06:00
Javan Makhmali
ab28276713 Connection#isAlive 2016-02-23 09:37:49 -06:00
Pratik Naik
96118db335 Log ConnectionMonitor connect 2016-02-23 09:37:49 -06:00
Pratik Naik
426676e8d0 Confirm connection monitor subscription on open 2016-02-23 09:37:49 -06:00
Pratik Naik
725c913c90 Treat 'closing' state as closed.
We are seeing cases where the websockets get stuck in the 'closing' state
after a tab has been in background for a while. So lets treat those websockets
as closed.
2016-02-23 09:37:49 -06:00
Javan Makhmali
832f88bdf3 Add client-side console logging to help debug reconnect issues 2016-02-23 09:37:49 -06:00
Tara Scherner de la Fuente
926a24a751 remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
Mehmet Emin İNAÇ
e8f4954086 Action Cable readme fix [ci skip] 2016-02-23 04:16:22 +02:00
Rafael França
d3f0aa36c3 Merge pull request #23668 from maclover7/cable-docs
Full Action Cable documentation read through
2016-02-22 22:55:39 -03:00
Jon Moss
cf423f8f76 Add notes for future selves
Once RubyGems 2.5.0 is required, then the duplicated files can be
removed, and symlinks can be used instead.

[ci skip]
2016-02-22 20:46:11 -05:00
Jon Moss
83921b8f87 Generate ApplicationCable files if they do not already exist 2016-02-22 20:46:06 -05:00
Chashmeet Singh
3f97d77372 Fixed typo 2016-02-21 14:09:42 +05:30
David Heinemeier Hansson
2a83a6e878 Merge pull request #23709 from jankeesvw/set-action-cable-logging-to-debug
Make ActionCable logging less verbose in development
2016-02-19 16:04:24 +01:00
Matthew Draper
6da571add8 Merge pull request #23715 from maclover7/fix-unsubscribe
Fix `unsubscribed` server side behavior
2016-02-19 11:17:51 +10:30
Jon Moss
cefcc0f66e Fix unsubscribed server side behavior
Before this commit, the `unsubscribed` callbacks in Action Cable server
side channels were never called. This is because when a WebSocket
"goodbye" message was sent from the client, the Action Cable server
didn't properly clean up after the now closed WebSocket. This means that
memory could possibly skyrocket with this behavior, since part of this
commit is to properly remove closed subscriptions from the global
subscriptions hash. Say you have 10,000 users currently connected, and
then all 10,000 disconnect -- before this patch, Action Cable would
still hold onto information (and Ruby objects!) for all of these now
dead connections.
2016-02-18 16:26:17 -05:00