bolt_rb 0.2.0 → 0.2.1
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/lib/bolt_rb/socket_mode/client.rb +11 -0
- data/lib/bolt_rb/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: 98c7fbaaad567ebdc0dee109df68cbb084cbaba4d532138b37e518e96893a23a
|
|
4
|
+
data.tar.gz: d5cbcffc369f50cf85211ec54ed77e2b3cefababccd4d52b2da0c624527de54f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 858c0cbf0ef13c010fa11594ffca9d5aa4949f0c4b8bc4d660b98faed05a76a0b65977f8bb7f9b6291a726d9f5d7f3527bd1876007d3e56a838f3a1109969aa1
|
|
7
|
+
data.tar.gz: 9f7a90ce248a549729598d80af6a3495ed491d45c9a25c7d0226b19dac6e8ae8be3b3d46afa3b3bbb78cbf7ace90e9a7181fde7a985b22f62aa28c23f203a058
|
|
@@ -99,9 +99,18 @@ module BoltRb
|
|
|
99
99
|
#
|
|
100
100
|
# @return [void]
|
|
101
101
|
def run_loop
|
|
102
|
+
last_heartbeat = Time.now
|
|
103
|
+
heartbeat_interval = 60 # Log every 60 seconds
|
|
104
|
+
|
|
102
105
|
while @running
|
|
103
106
|
sleep 0.1
|
|
104
107
|
reconnect_if_needed
|
|
108
|
+
|
|
109
|
+
# Periodic heartbeat to confirm the loop is alive
|
|
110
|
+
if Time.now - last_heartbeat >= heartbeat_interval
|
|
111
|
+
logger.debug "[SocketMode] Heartbeat: connected=#{connected?}, websocket_open=#{@websocket&.open?}"
|
|
112
|
+
last_heartbeat = Time.now
|
|
113
|
+
end
|
|
105
114
|
end
|
|
106
115
|
ensure
|
|
107
116
|
# Clean up websocket when loop exits
|
|
@@ -206,6 +215,8 @@ module BoltRb
|
|
|
206
215
|
# @param msg [WebSocket::Client::Simple::Message] The message
|
|
207
216
|
# @return [void]
|
|
208
217
|
def handle_message(msg)
|
|
218
|
+
logger.debug "[SocketMode] Raw message received: #{msg.data&.truncate(200) || '(nil)'}"
|
|
219
|
+
|
|
209
220
|
# Skip nil, empty, or non-JSON data (like WebSocket ping/pong frames)
|
|
210
221
|
return if msg.data.nil? || msg.data.empty? || !msg.data.start_with?('{')
|
|
211
222
|
|
data/lib/bolt_rb/version.rb
CHANGED