mbeditor 0.12.3 → 0.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88d963e43c97cf6974b3e38c079ffd2dba642dc1c13a68237f1a3a4f7c21e9a0
4
- data.tar.gz: 9e32a366d6ea7ce5014fff94ee89adba7f6909d09aa29f6404142b4155688a3a
3
+ metadata.gz: 2c1571b1f86252311dec23f5374b7a6c08aa43fc1aafc8b32a05d78785da98f6
4
+ data.tar.gz: 4a1ed11cfe1110b09236cb962b3fa4b39852f95c7d475874168eb4be89d45bac
5
5
  SHA512:
6
- metadata.gz: 100805339d3956837f0ec5349de86b5bcf4315ef5dd261e76b80c0acb589cd9036264b70bb65677be3d27be9575007daee02e08c1cbad86ac3136bd331312a6b
7
- data.tar.gz: d1d0681c8962251ceb0d9f18db0937e20f3c1ae1e2d30754a08a88ee10a47b6a6492641de84b9e83c0b2ab81963e79d1f3d86bb61a985bfa7b4a5eb579d0548d
6
+ metadata.gz: 2f121024e7786d741c103153fdf076455bc1c5d48d24c69339c3b4d81cc88141c616f25a9b160db24a7361806a4a20a9a9d7cf5781549b7e8e3db1687a0eb124
7
+ data.tar.gz: b0d635e44478ce7b6422b775250951ae5c947a697e2b86225c6a4d4a8b744fd066c0a2269f6a8afa59acd459600aa5960db8fac7bd8b7bfa84f27f36d44ed03f
data/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.12.4] - 2026-08-03
11
+
12
+ ### Fixed
13
+ - **Rejected-subscription logging flooded the console.** 0.12.3 made a silent
14
+ failure visible, which was right, but logged every occurrence — and a
15
+ rejection is not a one-off: the client retries every 30 seconds, every open
16
+ tab retries independently, and both the editor channel and every per-file
17
+ collaboration room authenticate. One message per distinct reason per five
18
+ minutes now, which says the same thing without drowning the log.
19
+
20
+
10
21
  ## [0.12.3] - 2026-08-03
11
22
 
12
23
  ### Added
@@ -50,13 +50,40 @@ module Mbeditor
50
50
  Mbeditor.configuration.authenticate_with
51
51
  end
52
52
 
53
+ # Throttled hard, because a rejection is not a one-off event: the client
54
+ # retries every 30s, every open tab retries independently, and both the
55
+ # editor channel and every per-file collaboration room authenticate. Logging
56
+ # each one turned a silent failure into a flooded console, which is no more
57
+ # usable. One message per distinct reason per interval says the same thing.
58
+ LOG_THROTTLE_SECONDS = 300
59
+ LOG_MUTEX = Mutex.new
60
+ private_constant :LOG_MUTEX
61
+
62
+ def self.last_logged
63
+ @last_logged ||= {}
64
+ end
65
+
53
66
  def mbeditor_log_denial(reason)
67
+ now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
68
+ should_log = LOG_MUTEX.synchronize do
69
+ seen = ChannelAuthentication.last_logged
70
+ previous = seen[reason]
71
+ if previous.nil? || (now - previous) > LOG_THROTTLE_SECONDS
72
+ seen[reason] = now
73
+ true
74
+ else
75
+ false
76
+ end
77
+ end
78
+ return unless should_log
79
+
54
80
  Rails.logger&.warn(
55
81
  "[mbeditor] WebSocket subscription rejected: #{reason}. " \
56
82
  "Realtime collaboration will not work. A WebSocket subscribe runs no " \
57
83
  "controller, so Current.*, Authlogic sessions and other request-scoped " \
58
84
  "state set by before_actions are unavailable here — resolve the user " \
59
- "from `session` instead, or set config.cable_authenticate_with."
85
+ "from `session` instead, or set config.cable_authenticate_with. " \
86
+ "(Further identical rejections suppressed for #{LOG_THROTTLE_SECONDS}s.)"
60
87
  )
61
88
  rescue StandardError
62
89
  # Logging must never be the thing that breaks the socket.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mbeditor
4
- VERSION = "0.12.3"
4
+ VERSION = "0.12.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Noonan