Commit Graph

700 Commits

Author SHA1 Message Date
zzak
d2af670dba
Remove Copyright years (#47467)
* Remove Copyright years

* Basecamp is now 37signals... again

Co-authored-by: David Heinemeier Hansson <dhh@hey.com>

---------

Co-authored-by: David Heinemeier Hansson <dhh@hey.com>
2023-02-23 11:38:16 +01:00
Yasuo Honda
f838a74212
Merge pull request #46866 from ghousemohamed/change-year-2022-to-2023 2023-02-13 13:15:43 +09:00
Rafael Mendonça França
177b9494e3
[Action Cable] Stop logging filtered params
Co-Autored-By: Kartikey Tanna <tannakartikey@gmail.com>
2023-02-08 17:22:39 +00:00
Haroon Ahmed
df00a4ebc7 Update the ActionCable::Connection::Base to no longer output env data and other stuff by overriding the inspect method and displaying a simpler output. 2023-02-06 11:02:34 +00:00
Jean Boussier
3d0d027bfd
Merge pull request #47204 from StephaneRob/feat-improve-assert-broadcast-on-message
feat: improve `assert_broadcast_on` error message
2023-02-05 00:24:46 +01:00
StephaneRob
1333260e11 feat: improve assert_broadcast_on error message 2023-02-04 19:48:41 +01:00
Matthew Draper
4b560ab00c Increase redis subscription timeout in Action Cable test 2023-02-04 21:58:17 +10:30
zzak
f8544410a2 Use stable guides link for package READMEs
E.g.: These show up here:
https://api.rubyonrails.org/files/actioncable/README_md.html
2023-02-04 09:01:00 +09:00
zzak
b1f605471d Add changelog for #41415 2023-01-27 19:10:23 +09:00
Rafael Mendonça França
847cc9f8cb
Merge pull request #41415 from zedtux/features/actioncable/token
Allows passing sub protocols with ActionCable
2023-01-18 16:37:55 -05:00
Akira Matsuda
4c23742a13
delegate to: :class has to be defined after the target method
in order to derive the arity from the target class method.
2023-01-11 04:32:08 +09:00
Ghouse Mohamed
e0559d2c1c Change 2022 -> 2023 2023-01-03 13:22:00 +05:30
Akira Matsuda
9f141a423d
Module name typo in documentation 2022-12-26 23:13:04 +09:00
Akira Matsuda
4732c91d14
Trivial fix on CHANGELOG 2022-12-26 19:53:17 +09:00
Hartley McGuire
a07f2ace03
Fix lots of code highlighting issues
The most common is replacing back-ticks with either pluses or tt tags.
There were also a few instances of code blocks not being indented.
2022-11-29 00:51:02 -05:00
Étienne Barrié
3d6a7b2faa Initialize deprecators before configuring them
Since engine initializers run later in the process, we need to run this
initializer earlier than the default.

This ensures they're all registered before the environments are loaded.
2022-11-28 10:47:26 +01:00
Vladimir Dementyev
ae649b152e
feat: restore Action Cable Redis pub/sub listener on connection failure
Closes #27659
2022-11-23 21:53:10 -05:00
Jonathan Hefner
1edc5ea918
Merge pull request #46427 from cpb/cpb-fix-clear-reloadable-connections-deprecation-warning
Fix clear_reloadable_connections! deprecation warning
2022-11-04 18:31:59 -05:00
Caleb Buxton
598e9f36cb Fix clear_reloadable_connections! deprecation warning
This fixes the following warning when running Action Cable tests:

  ```
  DEPRECATION WARNING: Calling `ActiveRecord::Base.clear_reloadable_connections! is deprecated. Please call the method directly on the connection handler; for example: `ActiveRecord::Base.connection_handler.clear_reloadable_connections!`.
  ```
2022-11-04 15:50:48 -07:00
Caleb Buxton
6e9675c6bf Fix clear_all_connections! NoMethodError
This fixes the following error when running Action Cable tests:

  ```
  NoMethodError: undefined method `clear_all_connections!' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
  actioncable/test/subscription_adapter/postgresql_test.rb:38:in `teardown'
  ```
2022-11-04 15:30:33 -07:00
Jonathan Hefner
5a4eadd51c Add ActionCable.deprecator
This commit adds `ActionCable.deprecator`, and adds it to
`Rails.application.deprecators` so that it can be configured via
settings such as `config.active_support.report_deprecations`.
2022-11-01 17:39:39 -05:00
Jonathan Hefner
25ae059d16 Fix clear_all_connections! deprecation warning
This fixes the following warning when running Action Cable tests:

  ```
  DEPRECATION WARNING: Calling `ActiveRecord::Base.clear_all_connections! is deprecated. Please call the method directly on the connection handler; for example: `ActiveRecord::Base.connection_handler.clear_all_connections!`.
  ```
2022-10-25 15:01:42 -05:00
Guillaume Hain
6edb465bcf
Allows adding more protocols to the WebSocket sub protocols 2022-10-19 09:00:15 +02:00
Petrik de Heus
cf2be23577
Merge pull request #45469 from skryukov/docs-for-action-cable-channel-callbacks [ci-skip]
Document Action Cable Callbacks
2022-10-18 21:28:52 +02:00
Jean Boussier
d917896f45 Enable verbose mode in test and report warnings as errors
We recently let a few very easy to avoid warnings get merged.
The root cause is that locally the test suite doesn't run in
verbose mode unless you explictly pass `-w`.

On CI warnings are enabled, but there is no reason to look at the
build output unless something is failing. And even if one wanted
to do that, that would be particularly work intensive since warnings
may be specific to a Ruby version etc.

Because of this I believe we should:

  - Always run the test suite with warnings enabled.
  - Raise an error if a warning is unexpected.

We've been using this pattern for a long time at Shopify both in private
and public repositories.
2022-10-11 09:25:18 +02:00
mansakondo
3a6ab41595 Fix #45738 2022-09-25 14:57:32 +02:00
MSP-Greg
6c674e4425
Updates for Puma 6 2022-09-22 12:40:54 -05:00
Mansa Keïta
09152576d6
Add CHANGELOG entry for #45738 [ci-skip] (#46056) 2022-09-17 19:34:21 +05:30
mansakondo
27a967ef70 Add ability to handle reconnects with the connected() callback 2022-09-14 12:14:58 +02:00
Kim Yu Ng
cbc56b6a9e prevent leaking sensitive payload 2022-08-25 10:07:23 -05:00
Jean Boussier
7587b7e99a Action Cable redis-rb 5+ compatibility
- Pass configuration as symbols
- Stop messing with the raw client
2022-08-22 09:01:27 +02:00
Jean Boussier
71c24aa0bc Refactor Action Cable's Redis adapter to isolate the layer breach 2022-08-22 09:01:27 +02:00
Jean Boussier
7559957ba2 Require redis 4+ in Action Cable
RedisCacheStore already does, no point keeping compatiblity
with 3.x.

Redis 4+ always responds to `_client` so we can simplify the code.
2022-08-22 09:01:27 +02:00
Jean Boussier
f2ab66da73 Stop testing hiredis
The driver being used is an implementation detail of `redis-rb`.
If somehow something break on one driver but not the other, it should
be reported to redis-rb and fixed there.

Also `redis-rb` `5.0` has a totally new client and hiredis binding
so all this code no longer works with redis-rb 5.0.
2022-08-22 09:01:27 +02:00
Erol Fornoles
69c8b6b3d1
Correct the description for reject_unauthorized_connection 2022-08-08 09:23:01 +08:00
Alex Ghiculescu
1ee984dfe4 Anchor the Action Cable server's route
Fixes https://github.com/rails/rails/issues/45489

- Adds `anchor: true` to the Action Cable server mount, so that it only strictly matches `/cable` rather than anything that starts with that.
- Uses `reverse_merge` instead of `merge` in `Mapper#mount`, so that you can override these options if you need to.
2022-06-29 13:26:49 -05:00
Svyatoslav Kryukov
080f9b4c98
Document Action Cable Connection Callbacks 2022-06-28 15:36:52 +03:00
Svyatoslav Kryukov
b66df44f1f
Document Action Cable Channel Callbacks 2022-06-27 10:34:48 +03:00
Gannon McGibbon
19875bedd7 Improve channel generator usage docs
- Makes heading styles consistent with other generators
- Adds backticks to code snippets
- Adds more examples
2022-06-21 00:30:37 -05:00
Dominik Malis
cef3342e40
Connections Map changed to Each in ping task
No need to make new array containing all connections because returned value of map is not used
2022-06-16 13:20:14 +02:00
Xavier Noria
3bcd48f6d8 Require Zeitwerk 2.6 2022-06-13 23:43:42 +02:00
Jean Boussier
115be62709 Wrap rails runner in executor
The main reason is to automatically report uncaught exceptions
since `rails runner` is often used for cron tasks and such.
2022-06-10 14:16:49 +02:00
Gannon McGibbon
3dad2919d5 Rename behaviour to behavior in documentation 2022-05-26 17:14:18 -04:00
Jeremy Daer
df88a42e5f Merge branch 'main' into feat/ac-remote-disconnect-notice
* main: (21 commits)
  feat: action cable connection callbacks
  fix: action cable stream_test errors
  Adds test coverage for #attach method behaviour in activestorage
  Address QueryCacheTest#test_query_cache_does_not_allow_sql_key_mutation failure
  Fixes ActiveStorage proxy downloads of files over 5mb in S3-like storage services
  Fixes development Action Mailbox new mail form
  Squash commits
  Include the unexpected class in InvalidParameterKey message
  Support unbounded time ranges for PostgreSQL
  Fix CHANGELOG alignment [ci-skip]
  Add ability to ignore tables by regexp for SQL schema dumps
  Improve `rails s` error message when no server could be found.
  Fix MySQL warning when creating Active Record's test databases
  Add `--js` and --skip-javascript` options to `rails new`
  Fix parsing operator classes for index columns in PostgreSQL
  Fix rails test command to handle leading dot slash
  Document that url_for can take classes
  Don't change the encoding of frozen parameters
  Update working_with_javascript_in_rails.md
  Avoid query from calculations on contradictory relation
  ...
2022-05-16 12:40:31 -07:00
Vladimir Dementyev
5d6c1f64ea feat: action cable connection callbacks 2022-05-16 12:24:38 -07:00
Vladimir Dementyev
c5423e9a9c fix: action cable stream_test errors 2022-05-16 12:22:09 -07:00
Vladimir Dementyev
2d0f9c5844 Send disconnect message during remote disconnect
Send {type: :disconnect} message to a client before closing the connection when initiated by server.remote_connections.where(...).disconnect
2022-05-11 13:59:23 -04:00
Ghouse Mohamed
6ee6cb554b Fix #version docs and some typos 2022-03-16 01:48:37 +05:30
Xavier Noria
645239817d Refactor Zeitwerk setup in Action Cable
I am trying to find a sweet spot here.

Personally, not quite satisfied by having lib/action_cable/zeitwerk.rb. At the
same time, trying to avoid too taking much space in lib/action_cable.rb.

This patch also moves

    require_relative "action_cable/version"

within ActionCable. Why? In a project, I like that the entrypoint defines the
namespace. That is the main file for that namespace.

Then, files below have it already created, and reopen it.

I just find this deliberate order of execution to be natural, hierarchical,
matching the project structure.
2022-03-06 19:52:36 +01:00
Xavier Noria
61bbcb71d5 Add missing magic comment (linting) 2022-03-05 14:25:52 +01:00