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 +4 -4
- data/CHANGELOG.md +11 -0
- data/app/channels/mbeditor/channel_authentication.rb +28 -1
- data/lib/mbeditor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c1571b1f86252311dec23f5374b7a6c08aa43fc1aafc8b32a05d78785da98f6
|
|
4
|
+
data.tar.gz: 4a1ed11cfe1110b09236cb962b3fa4b39852f95c7d475874168eb4be89d45bac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
data/lib/mbeditor/version.rb
CHANGED