aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable
Commit message (Collapse)AuthorAgeFilesLines
* Preparing for 5.2.0.beta2 releaseRafael Mendonça França2017-11-283-2/+7
|
* Fix typos and add a few suggestionsFatos Morina2017-11-281-1/+1
|
* Preparing for 5.2.0.beta1 releaseRafael Mendonça França2017-11-273-2/+4
|
* Fix unstable test test_delegate_socket_errors_to_on_error_handlerFumiaki MATSUSHIMA2017-11-231-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I often face the following error when running test/connection/client_socket_test.rb: ``` $ bin/test test/connection/client_socket_test.rb:38 Run options: --seed 44035 # Running: F Failure: ActionCable::Connection::ClientSocketTest#test_delegate_socket_errors_to_on_error_handler [/app/actioncable/test/connection/client_socket_test.rb:47]: --- expected +++ actual @@ -1 +1 @@ -["foo"] +["Broken pipe", "Broken pipe", "Broken pipe", "foo"] ``` It can be reproduced easily by applying the following patch: ``` diff --git a/actioncable/test/connection/client_socket_test.rb b/actioncable/test/connection/client_socket_test.rb index 2051216010..6bb9f13ea7 100644 --- a/actioncable/test/connection/client_socket_test.rb +++ b/actioncable/test/connection/client_socket_test.rb @@ -34,7 +34,8 @@ def on_error(message) @server.config.allowed_request_origins = %w( http://rubyonrails.com ) end - test "delegate socket errors to on_error handler" do + 1000.times do |i| + test "delegate socket errors to on_error handler #{i}" do run_in_eventmachine do connection = open_connection @@ -47,6 +48,7 @@ def on_error(message) assert_equal %w[ foo ], connection.errors end end + end test "closes hijacked i/o socket at shutdown" do run_in_eventmachine do ``` The cause is writing io from different thread at the same time. `connection.process` sends handshake message from [StreamEventLoop's thread][] whereas `connection.handle_open` sends welcome message from current thread. [StreamEventLoop's thread]: https://github.com/rails/rails/blob/067fc779c4560fff4812614a2f78f9248f3e55f8/actioncable/lib/action_cable/connection/stream_event_loop.rb#L75
* Use .tt extension to all the template filesRafael Mendonça França2017-11-136-0/+0
| | | | | | | | Make clear that the files are not to be run for interpreters. Fixes #23847. Fixes #30690. Closes #23878.
* Action Cable: run Redis tests against a default config without a passwordJeremy Daer2017-11-131-2/+21
| | | | | | | | Simplify our dev testing and CI story since we're also testing against Redis for the Active Support cache store. Directly test whether db, host, password, etc are passed through as config instead of spinning up a Redis server with a password set on it.
* Enable `Style/RedundantReturn` rubocop rule, and fixed a couple moreRyuta Kamizono2017-11-011-1/+1
| | | | Follow up of #31004.
* Remove CHANGELOG entry that was backported to Rails 5.1.3. [ci skip] (#30986)प्रथमेश Sonpatki2017-10-251-7/+0
| | | - Backport commit: https://github.com/rails/rails/commit/7122a2cdc3634e170129f8b6cabd1e8fbed13c3d
* Removed deprected evented redis adapterRafael Mendonça França2017-10-234-151/+5
|
* [Action Cable] require_relative => requireAkira Matsuda2017-10-213-3/+3
| | | | This basically reverts f851e1f705f26d8f92f0fc1b265b20bc389d23cb
* Merge pull request #30748 from jeremy/redis-rb-4.0.1Jeremy Daer2017-10-083-3/+7
|\ | | | | redis-rb 4.0 support
| * redis-rb 4.0 supportJeremy Daer2017-10-083-3/+7
| | | | | | | | | | | | | | | | * Use `gem 'redis', '~> 4.0'` for new app Gemfiles * Loosen Action Cable redis-rb dep to `>= 3.3, < 5` * Bump redis-namespace for looser Redis version dep * Avoid using the underlying `redis.client` directly * Use `Redis.new` instead of `Redis.connect`
* | Distinguish missing adapter gems from load errors within the adapterJeremy Daer2017-10-081-3/+16
|/ | | | | | | | * When the adapter is missing, raise an exception that points out config typos and missing Gemfile entries. (We can assume that a non-builtin adapter was used since these are always available.) * When loading an adapter raises a LoadError, prefix its error message to indicate that the adapter is likely missing an optional dependency.
* ActionCable: use find method when unsubscribingRichard Machielse2017-09-261-1/+1
| | | | | | | | | | If a frontend for some reason tries to unsubscribe from a non existing subscription, the following error is logged: Could not execute command from ({"command"=>"unsubscribe", "identifier"=>"{\"channel\":\"SomeChannel\"}"}) [NoMethodError - undefined method `unsubscribe_from_channel' for nil:NilClass] Instead, it will now properly log: Could not execute command from ({"command"=>"unsubscribe", "identifier"=>"{\"channel\":\"SomeChannel\"}"}) [RuntimeError - Unable to find subscription with identifier: {"channel":"SomeChannel"}]
* Fix quotes [ci skip]Yauheni Dakuka2017-09-181-2/+2
|
* Clarify intentions around method redefinitionsMatthew Draper2017-09-011-0/+2
| | | | | | | | | Don't use remove_method or remove_possible_method just before a new definition: at best the purpose is unclear, and at worst it creates a race condition. Instead, prefer redefine_method when practical, and silence_redefinition_of_method otherwise.
* Use typewriter in doc for Action Cable [ci skip]Yoshiyuki Hirano2017-08-261-1/+1
|
* Update MIT licenses link [ci skip]Yoshiyuki Hirano2017-08-221-1/+1
|
* Attributes are protected, not private, to avoid the warningMatthew Draper2017-08-201-1/+2
|
* Capitalize RedisJon Moss2017-08-171-1/+1
| | | | [ci skip]
* Fix RuboCop offensesKoichi ITO2017-08-161-1/+1
| | | | And enable `context_dependent` of Style/BracesAroundHashParameters cop.
* Remove unused `close_connection` in Action Cable tests (#30195)Ryuta Kamizono2017-08-112-8/+0
|
* [ci skip] Prefer cookies.encrypted over signed (#30129)Claudio B2017-08-072-2/+2
| | | | | | | | | | | | | | | | In some examples and guides we are recommending to use code like: ```ruby verified_user = User.find_by(id: cookies.signed[:user_id]) ``` My suggestion is to use instead: ```ruby verified_user = User.find_by(id: cookies.encrypted[:user_id]) ``` which invites users to prefer the "newer" encrypted cookies over the "legacy" signed cookies.
* Lint actioncable/CHANGELOG.mdJon Moss2017-08-061-3/+3
| | | | | | | Postgres --> PostgreSQL ActionCable --> Action Cable [ci skip]
* Use frozen string literal in actioncable/Kir Shatrov2017-07-2380-1/+158
|
* Make actioncable ready for frozen stringsKir Shatrov2017-07-231-1/+5
|
* Fix postgresql adapter setup for ActionCable testspalkan2017-07-111-1/+1
| | | | | (cherry picked from commit e2093c1f678175bde7c37c848686d979427346e1) (cherry picked from commit d7dbe48273bd9e0adb1de5b52e3cdaeb4a65630b)
* [Fix #28751] Hash stream long stream identifiers when using Postgres adapterpalkan2017-07-063-3/+31
|
* Merge branch 'master' into require_relative_2017Xavier Noria2017-07-021-13/+3
|\
| * Remove redundant `assert_respond_to`Ryuta Kamizono2017-07-031-13/+3
| | | | | | | | It is covered by following assertion.
| * Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-0280-80/+0
| | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
| * Enforce frozen string in RubocopKir Shatrov2017-07-0180-0/+80
| |
* | [Action Cable] require => require_relativeAkira Matsuda2017-07-013-3/+3
|/
* Merge pull request #29588 from greysteil/add-gemspec-linksRafael França2017-06-281-0/+5
|\ | | | | Add source code and changelog links to gemspecs
| * Add source code and changelog links to gemspecsGrey Baker2017-06-281-0/+5
| |
* | Adds CHANGELOG for f55ecc6 [ci skip]Marc Rendl Ignacio2017-06-271-0/+9
| |
* | Allows for other common redis options to be in cable.yml, by defaultMarc Ignacio2017-06-223-3/+13
|/ | | | | | | | | | | | | | | | | | - Adds RedisAdapterTest::AlternateConfiguration to account for a relatively common alternative setup, as it’s used as the first example in the [Redis rubygem](https://github.com/redis/redis-rb#getting-started) - Supplies original RedisAdapterTest with more complete redis:// url format by adding a ‘userinfo’ (blank user), so that it resembles the alternate configuration - Supplies original EventedRedisAdapterTest with more complete redis:// url as well - Adds before_script to start redis-server with password as a daemon and with explicit defaults copied from the default redis.conf (Instead of using Travis' default init/upstart scripts for `redis` service)
* nodoc AC::Connection::WebSocketT.J. Schuck2017-06-161-1/+1
| | | | | Users should never publicly be interacting with an instance of this. The instance that comes along with an `AC::Connection::Base` instance (the only thing a user should be working with) is [itself intended to be private](https://github.com/tjschuck/rails/blob/master/actioncable/lib/action_cable/connection/base.rb#L137-L140). [ci skip]
* Use `require_relative` instead of `require` with full pathbogdanvlviv2017-06-147-9/+9
|
* Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-033-4/+4
|
* Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-292-4/+2
| | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
* Define path with __dir__bogdanvlviv2017-05-235-10/+8
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* identifiers is already defined via Connection::Identification moduleAkira Matsuda2017-05-211-1/+1
|
* Suppress `warning: assigned but unused variable - stdout`Koichi ITO2017-05-121-1/+1
|
* Cleanup CHANGELOGs [ci skip]Ryuta Kamizono2017-04-301-1/+2
| | | | | | * Remove trailing spaces. * Add backticks around method and command. * Fix indentation.
* Log any errors originating from the socketedwardmp2017-04-162-1/+8
|
* Work around all the thingsMatthew Draper2017-04-061-1/+11
|
* Avoid "can't modify frozen IOError" failuresMatthew Draper2017-04-051-5/+16
| | | | https://bugs.ruby-lang.org/issues/13239
* Rename local variable name `current_user` to `verified_user` [ci skip]Ryuta Kamizono2017-03-251-2/+2
| | | | | Assigning local variable named `current_user` in the condition is confusing.
* Revert "Merge pull request #28569 from HarryCollins/patch-1"Kasper Timm Hansen2017-03-251-1/+1
| | | | | | | This reverts commit 296d024b4e91c4891ae0b010249193513e63b921, reversing changes made to e341d835070c7ef9990f41e02bbf46536be0aee7. We aren't trying to compare to current_user, we're assigning that variable.