anycable-rails 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/anycable/rails/action_cable_ext/channel.rb +1 -1
- data/lib/anycable/rails/action_cable_ext/connection.rb +1 -1
- data/lib/anycable/rails/connection.rb +7 -5
- data/lib/anycable/rails/railtie.rb +4 -3
- data/lib/anycable/rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 249493f023d0c0b2e8f85bba263132f7b8bb440073184f68949e83b5911b191a
|
4
|
+
data.tar.gz: 055c60c21507d7307f73121948e134087d624f907d4435ad1ac0526337158464
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aee411822afddc35aeecbf85490f413e2c6b899107b3a849e25a449cf19baf13885cad9e52bbc25ab85b08316b865ff60f0fc0f558f0ebffc0a175e5d983f30
|
7
|
+
data.tar.gz: e5933e165ca975e9ce32ec867b177583cc8e0718a9aa8f1f9435bbb515500a4f0de9e7cd82b34e7e0f9d1cf8db40114f0fedb49923ef63bfce418a9dd1cd7a76
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.3.3 (2022-04-20)
|
6
|
+
|
7
|
+
- Added `sid` (unique connection identifier) field to the `welcome` message if present. ([@palkan][])
|
8
|
+
|
9
|
+
- Fixed handling Ruby Logger incompatible loggers. ([@palkan][])
|
10
|
+
|
5
11
|
## 1.3.2 (2022-03-04)
|
6
12
|
|
7
13
|
- Allow Ruby 2.6.
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "action_cable
|
4
|
-
require "action_cable/channel"
|
3
|
+
require "action_cable"
|
5
4
|
|
6
5
|
module AnyCable
|
7
6
|
module Rails
|
@@ -13,8 +12,11 @@ module AnyCable
|
|
13
12
|
:anycable_socket
|
14
13
|
|
15
14
|
# Using public :send_welcome_message causes stack level too deep 🤷🏻♂️
|
16
|
-
def
|
17
|
-
|
15
|
+
def send_welcome_message
|
16
|
+
transmit({
|
17
|
+
type: ActionCable::INTERNAL[:message_types][:welcome],
|
18
|
+
sid: env["anycable.sid"]
|
19
|
+
}.compact)
|
18
20
|
end
|
19
21
|
|
20
22
|
def public_request
|
@@ -92,7 +94,7 @@ module AnyCable
|
|
92
94
|
|
93
95
|
socket.cstate.write(LOG_TAGS_IDENTIFIER, logger.tags.to_json) unless logger.tags.empty?
|
94
96
|
|
95
|
-
conn.
|
97
|
+
conn.send_welcome_message
|
96
98
|
rescue ::ActionCable::Connection::Authorization::UnauthorizedError
|
97
99
|
reject_request(
|
98
100
|
ActionCable::INTERNAL[:disconnect_reasons]&.[](:unauthorized) || "unauthorized"
|
@@ -20,13 +20,14 @@ module AnyCable
|
|
20
20
|
AnyCable.logger = ::ActionCable.server.config.logger
|
21
21
|
|
22
22
|
AnyCable.configure_server do
|
23
|
-
AnyCable.logger =
|
23
|
+
server_logger = AnyCable.logger = ::ActionCable.server.config.logger
|
24
|
+
AnyCable.logger = ActiveSupport::TaggedLogging.new(server_logger) if server_logger.is_a?(::Logger)
|
24
25
|
# Broadcast server logs to STDOUT in development
|
25
26
|
if ::Rails.env.development? &&
|
26
27
|
!ActiveSupport::Logger.logger_outputs_to?(::Rails.logger, $stdout)
|
27
28
|
console = ActiveSupport::Logger.new($stdout)
|
28
|
-
console.formatter = ::Rails.logger.formatter
|
29
|
-
console.level = ::Rails.logger.level
|
29
|
+
console.formatter = ::Rails.logger.formatter if ::Rails.logger.respond_to?(:formatter)
|
30
|
+
console.level = ::Rails.logger.level if ::Rails.logger.respond_to?(:level)
|
30
31
|
AnyCable.logger.extend(ActiveSupport::Logger.broadcast(console))
|
31
32
|
end
|
32
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anycable-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anycable
|
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
- !ruby/object:Gem::Version
|
206
206
|
version: '0'
|
207
207
|
requirements: []
|
208
|
-
rubygems_version: 3.
|
208
|
+
rubygems_version: 3.3.7
|
209
209
|
signing_key:
|
210
210
|
specification_version: 4
|
211
211
|
summary: Rails adapter for AnyCable
|