aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable
Commit message (Collapse)AuthorAgeFilesLines
* Start Rails 6.1 developmentRafael Mendonça França2019-04-243-155/+4
|
* ActionCable: don't allowlist keys passed to the Redis initializerBlake Stoddard2019-04-222-3/+5
| | | Support all Redis features without needing to maintain a list of valid options that must stay in sync with the upstream client library.
* s/Travis/Buildkite/Matthew Draper2019-04-091-3/+3
|
* Output junit format test reportFumiaki MATSUSHIMA2019-04-041-0/+2
|
* Simplify ActionCable.createWebSocketURL and realphabetize exports (#35810)rmacklin2019-04-024-12/+17
| | | | | | | | | | | * Remove unnecessary variable from ActionCable.createWebSocketURL * Improve ActionCable test by creating the Consumer before reassigning URL With this change, the test now actually verifies that the Consumer's url property changes dynamically (from testURL to `${testURL}foo`). * Fix alphabetization of ActionCable exports
* url -> URL where apt except inside actionpack/Sharang Dashputre2019-04-011-1/+1
|
* feat(js): Dynamic ActionCable URL (#35579)Ryan Castner2019-03-314-32/+62
| | | | | | | | | | | | | | | | | * Failing test case * feat: Dynamic Url Generation Change createWebSocketURL to be a closure that allows url to be evaluated at the time the webSocket is established * refactor: createWebSocketURL to Consumer, remove need for closure Move initial call to createWebSocketURL in createConsumer * docs: Add documentation for dynamic url and string args to createConsumer Co-Authored-By: rmacklin <rmacklin@users.noreply.github.com> [Ryan Castner, rmacklin]
* Merge tag 'v6.0.0.beta3'eileencodes2019-03-133-2/+7
|\ | | | | | | v6.0.0.beta3 release
| * Prep releaseeileencodes2019-03-113-2/+7
| | | | | | | | | | | | | | * Update RAILS_VERSION * Bundle * rake update_versions * rake changelog:header
* | Fix style issues and build source after #35525Kasper Timm Hansen2019-03-112-4/+5
| | | | | | | | | | | | Ran `cd actioncable && yarn build`. [ Kasper Timm Hansen & Ryan Castner ]
* | Merge pull request #35525 from ↵Kasper Timm Hansen2019-03-112-3/+13
|\ \ | | | | | | | | | | | | audiolion/feature/dynamic-actioncable-websocket-url feat(js): Dynamic Actioncable WebSocket URL
| * | address pr feedbackRyan Castner2019-03-091-6/+2
| | | | | | | | | change if statement to ternary, use const for consistency, add spacing after ternary expression
| * | feat(js): Dynamic Actioncable WebSocket URLRyan Castner2019-03-072-3/+17
| |/ | | | | | | Allow createWebSocketURL fn to accept a function to generate the websocket URL rather than a string.
* / Updated links from http to https in guides, docs, etcAbhay Nikam2019-03-092-2/+2
|/
* Preparing for 6.0.0.beta2 releaseRafael Mendonça França2019-02-253-2/+4
|
* Address uninitialized constant PostgresqlAdapterTest::ChannelPrefixTest ↵Yasuo Honda2019-02-151-0/+1
| | | | | | | | | | | | | | | (NameError) ``` $ bundle exec ruby -w -Itest test/subscription_adapter/postgresql_test.rb Traceback (most recent call last): 1: from test/subscription_adapter/postgresql_test.rb:8:in `<main>' test/subscription_adapter/postgresql_test.rb:10:in `<class:PostgresqlAdapterTest>': uninitialized constant PostgresqlAdapterTest::ChannelPrefixTest (NameError) ``` https://travis-ci.org/rails/rails/jobs/493530508 Follow up #35276
* feat: support channel_prefix in pg subscription adapterVladimir Dementyev2019-02-143-0/+9
|
* Allow passing custom config to ActionCable::Server::BaseVladimir Dementyev2019-02-123-11/+29
| | | | | That allows us to create a separate, isolated Action Cable server instance within the same app.
* Respect ENV variables when finding DBs etc for the test suiteMatthew Draper2019-02-062-3/+9
| | | | | If they're not set we'll still fall back to localhost, but this makes it possible to run the tests against a remote Postgres / Redis / whatever.
* Use ES6 short styleDavid Heinemeier Hansson2019-02-041-3/+3
|
* Match rails generator outputDavid Heinemeier Hansson2019-02-041-2/+2
|
* Add ActionCable channel/connection load hooksVladimir Dementyev2019-01-293-0/+17
|
* Add CHANGELOG entries for npm package renames [ci skip]Javan Makhmali2019-01-281-0/+6
|
* Merge pull request #35021 from palkan/refactor/broadcasting-for-testingKasper Timm Hansen2019-01-246-19/+55
|\ | | | | Action Cable: move channel_name to Channel.broadcasting_for
| * fix fixture syntax in cable docs and guidesVladimir Dementyev2019-01-221-3/+3
| |
| * Add note about broadcast_to/broadcasting_for to change logVladimir Dementyev2019-01-222-1/+25
| |
| * Add Channel#broadcast_toVladimir Dementyev2019-01-222-2/+2
| |
| * Move `channel_name` to Channel.broadcasting_forVladimir Dementyev2019-01-224-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That would allow us to test broadcasting made with channel, e.g.: ```ruby class ChatRelayJob < ApplicationJob def perform_later(room, msg) ChatChannel.broadcast_to room, message: msg end end ``` To test this functionality we need to know the underlying stream name (to use `assert_broadcasts`), which relies on `channel_name`. We had to use the following code: ```ruby assert_broadcasts(ChatChannel.broadcasting_for([ChatChannel.channel_name, room]), 1) do ChatRelayJob.perform_now end ``` The problem with this approach is that we use _internal_ API (we shouldn't care about `channel_name` prefix in our code). With this commit we could re-write the test as following: ```ruby assert_broadcasts(ChatChannel.broadcasting_for(room), 1) do ChatRelayJob.perform_now end ```
* | Fix attribute typo in ActionCable connection test requestSergey Ponomarev2019-01-231-2/+0
|/
* Preparing for 6.0.0.beta1 releaseRafael Mendonça França2019-01-183-2/+4
|
* Merge pull request #34959 from alkesh26/action-cable-typo-fixesRafael França2019-01-183-3/+3
|\ | | | | Typo fixes in action cable.
| * typo fixes in action cablealkesh262019-01-173-3/+3
| |
* | Merge pull request #34941 from rmacklin/allow-actioncable-to-run-in-web-workersJavan Makhmali2019-01-164-12/+12
|\ \ | | | | | | Avoid ReferenceError exceptions if ActionCable is used in a web worker
| * | Remove explicit `document` receiver from add/removeEventListener callsRichard Macklin2019-01-152-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows ActionCable to be used in a web worker, where the `document` global is undefined. Previously, attempting to use ActionCable inside a web worker would result in this exception after you try to open a connection: ``` ReferenceError: document is not defined ``` The visibilitychange event won't ever get triggered in a worker, so adding the listener is effectively a no-op there. But the listener is mainly a convenience, rather than a critical piece of the javascript interface, so using ActionCable in a worker will still work. (And you could listen for visibilitychange yourself in a window script, then tell the worker to reconnect if you still want that behavior.)
| * | Replace `window` references in ActionCable with `self`Richard Macklin2019-01-143-8/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, attempting to use ActionCable inside a web worker would result in an exception being thrown: ``` ReferenceError: window is not defined ``` By replacing the `window` reference with `self`, which is available in both a window context and a worker context, we can avoid this error. Ref: https://developer.mozilla.org/en-US/docs/Web/API/Window/self
* / Remove `frozen_string_literal` from Action Cable's template filesbogdanvlviv2019-01-161-2/+0
|/ | | | | | Related to 837f602fa1b3281113dac965a8ef96de3cac8b02 Fix the testing guide.
* Merge pull request #34934 from ↵Rafael França2019-01-143-16/+19
|\ | | | | | | | | rmacklin/simplify-actioncable-methods-after-decaffeination Clean up ActionCable JS a bit more after the CoffeeScript conversion
| * Simplify `this.isActive() && this.webSocket` into `this.isActive()`Richard Macklin2019-01-142-2/+2
| | | | | | | | | | | | | | | | | | in Connection#close. We can do this because `isActive()` can only return `true` if `this.webSocket` is truthy. (We can't have an active connection without having instantiated a WebSocket. This is confirmed in the code: Connection#isActive calls Connection#isState which calls Connection#getState, which checks if `this.webSocket` is truthy and returns `null` otherwise.)
| * Simplify ActionCable.getConfig, Connection#getProtocol, and Connection#closeRichard Macklin2019-01-143-7/+17
| | | | | | | | by relying on the implicit undefined return value
| * Simplify ActionCable.createConsumer by using default argumentRichard Macklin2019-01-142-10/+3
| |
* | Add Action Cable Testing guidesVladimir Dementyev2019-01-142-1/+5
| |
* | Add channel test generatorVladimir Dementyev2019-01-134-1/+34
|/
* Update Action Cable connection testing.Kasper Timm Hansen2019-01-142-57/+57
| | | | | | | | | | | | | | | * Don't reimplement assert_raises Also test what happens in case there's no explicit rejection. * Avoid OpenStruct. Remove space beneath private. * Simplify verification methods for code under test. * Match documentation with other Rails docs. Also remove mention of the custom path argument for now. Unsure how useful that really is.
* Merge pull request #34930 from ↵Ryuta Kamizono2019-01-141-544/+1
|\ | | | | | | | | bogdanvlviv/merge-actioncable-README.md-to-the-guide Merge `actioncable/README.md` to the Action Cable Overview guide [ci skip]
| * Merge `actioncable/README.md` to the Action Cable Overview guide [ci skip]bogdanvlviv2019-01-131-544/+1
| | | | | | | | | | | | | | | | | | | | | | | | In #34709 we updated the guide, but `actioncable/README.md` is still outdated. Instead of fixing content in the file. I suggest not duplicate the info that is already in the guide and instead remove the info from the file and just add a message: "You can read more about Action Cable in the [Action Cable Overview](https://edgeguides.rubyonrails.org/action_cable_overview.html) guide." The same approach is being used for Action Mailbox and Action Text, see #34812 and #34878.
* | Merge pull request #34845 from palkan/feature/action-cable-connection-testingKasper Timm Hansen2019-01-133-0/+434
|\ \ | |/ |/| Add ActionCable::Connection::TestCase
| * feature: add ActionCable::Connection::TestCaseVladimir Dementyev2019-01-023-0/+434
| |
* | Move all npm packages to @rails scopeJavan Makhmali2019-01-103-5/+5
| | | | | | | | Fixes #33083
* | Revert "Revert "Merge pull request #34387 from ↵Kasper Timm Hansen2019-01-081-0/+3
| | | | | | | | | | | | | | | | yhirano55/rails_info_properties_json"" I reverted the wrong commit. Damn it. This reverts commit f66a977fc7ae30d2a07124ad91924c4ee638a703.
* | Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json"Kasper Timm Hansen2019-01-081-3/+0
|/ | | | | | | | | | | We had a discussion on the Core team and we don't want to expose this information as a JSON endpoint and not by default. It doesn't make sense to expose this JSON locally and this controller is only accessible in dev, so the proposed access from a production app seems off. This reverts commit 8eaffe7e89719ac62ff29c2e4208cfbeb1cd1c38, reversing changes made to b6e4305c3bca4c673996d0af9db0f4cfbf50215e.