anycable-rails 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75584d70f4f8d966a74cfee8d0741bc5072aabcbab60a7fecc2c4532d7a9719c
4
- data.tar.gz: a4efe6de0db26e8f91a896350a142aa483d9305798fafc3e758b29c522e7cf3a
3
+ metadata.gz: d90b3f0b34ba001d46f7dee1f44bac4a123a986d60ef9a5779ca111fe1f95ee2
4
+ data.tar.gz: 398b67691ec76e6b687f1b2a1c88cc135e07e816aaa300a346345348a56c354c
5
5
  SHA512:
6
- metadata.gz: 64e79d37168a1d299d700cf86444e74e424a360b6d22fe6eb682ef0cba4ea648526a4ea603a5a032a709ed5308856df2d7cb8dedd634668afde239673ef89dd7
7
- data.tar.gz: aabcd20cbc91c4733d4978c9c99cf5d0574775badf9ef67fffea8a4a9b825c3b6e6b76c3581a4a75a3058f7ce3fb762a2b69dea4a8b2be935f0b75ea7e09fa0d
6
+ metadata.gz: 17d9d88780fd3b04d464bb6503e6d58501fd23f450988d191d959839789ac88b208f3fa73898572d9d52a058dcd884e302ba6fb9cec4019e2f471b5c726b0248
7
+ data.tar.gz: 987913b5565498cbe3e2ea076176146ef6e1ff04c0ab6d31a25f4c9bee55f7ffeda13c8bdf7530a75433e936de5fea2578857644d1f55e26bb42616eedd3a883
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.3.6 (2023-02-28)
6
+
7
+ - Handle `nil` streams gracefully. ([@palkan][])
8
+
9
+ - Report exceptions via the `Rails.error.report` interface. ([@palkan][])
10
+
5
11
  ## 1.3.5 (2023-01-04)
6
12
 
7
13
  - Make misconfiguration error more informative. ([@palkan][])
@@ -25,6 +25,8 @@ ActionCable::Channel::Base.prepend(Module.new do
25
25
  def stream_from(broadcasting, _callback = nil, **)
26
26
  return super unless anycabled?
27
27
 
28
+ broadcasting = String(broadcasting)
29
+
28
30
  connection.anycable_socket.subscribe identifier, broadcasting
29
31
  end
30
32
 
@@ -45,6 +45,12 @@ module AnyCable
45
45
  # see https://github.com/rails/rails/pull/33469/files
46
46
  executor = app.config.reload_classes_only_on_change ? app.reloader : app.executor
47
47
  AnyCable.middleware.use(AnyCable::Rails::Middlewares::Executor.new(executor))
48
+
49
+ if app.executor.respond_to?(:error_reporter)
50
+ AnyCable.capture_exception do |ex, method, message|
51
+ ::Rails.error.report(ex, handled: false, context: {method: method, payload: message})
52
+ end
53
+ end
48
54
  end
49
55
 
50
56
  initializer "anycable.connection_factory", after: "action_cable.set_configs" do |app|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AnyCable
4
4
  module Rails
5
- VERSION = "1.3.5"
5
+ VERSION = "1.3.6"
6
6
  end
7
7
  end
@@ -159,6 +159,10 @@ module AnyCableRailsGenerators
159
159
  !!gemfile_lock&.match?(/^\s+redis\b/)
160
160
  end
161
161
 
162
+ def nats?
163
+ !!gemfile_lock&.match?(/^\s+nats-pure\b/)
164
+ end
165
+
162
166
  def webpacker?
163
167
  !!gemfile_lock&.match?(/^\s+webpacker\b/)
164
168
  end
@@ -12,17 +12,14 @@
12
12
  default: &default
13
13
  # Turn on/off access logs ("Started..." and "Finished...")
14
14
  access_logs_disabled: false
15
- # Persist "dirty" session between RPC calls (might be required for apps using stimulus_reflex <3.0)
16
- # persistent_session_enabled: true
17
- # This is the host and the port to run AnyCable RPC server on.
18
- # You must configure your WebSocket server to connect to it, e.g.:
19
- # $ anycable-go --rpc-host="<rpc hostname>:50051"
20
- rpc_host: "127.0.0.1:50051"
21
15
  # Whether to enable gRPC level logging or not
22
16
  log_grpc: false
23
17
  <%- if redis? -%>
24
18
  # Use Redis to broadcast messages to AnyCable server
25
19
  broadcast_adapter: redis
20
+ <%- elsif nats? -%>
21
+ # Use NATS to broadcast messages to AnyCable server
22
+ broadcast_adapter: nats
26
23
  <%- else -%>
27
24
  # Use HTTP adapter for a quick start (since redis gem is not present in the project)
28
25
  broadcast_adapter: http
@@ -44,7 +41,8 @@ test:
44
41
 
45
42
  production:
46
43
  <<: *default
47
- <%- if !redis? -%>
48
- # Use Redis in production
44
+ <%- if !redis? && !nats? -%>
45
+ # Use Redis or NATS in production
49
46
  broadcast_adapter: redis
47
+ # broadcast_adapter: nats
50
48
  <%- 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.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-04 00:00:00.000000000 Z
11
+ date: 2023-03-01 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.3.11
208
+ rubygems_version: 3.4.6
209
209
  signing_key:
210
210
  specification_version: 4
211
211
  summary: Rails adapter for AnyCable