jetstream_bridge 7.1.2 → 7.1.3
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 +7 -0
- data/lib/jetstream_bridge/core/bridge_helpers.rb +17 -2
- data/lib/jetstream_bridge/version.rb +1 -1
- data/lib/jetstream_bridge.rb +15 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 960c62e2e115e43f9e9f850adda06a2fd9337a72ad0eb09f1b0e99be53b4b0c3
|
|
4
|
+
data.tar.gz: 011f110e84e31b9fbc69c388c34d4c1be47bba2bb44ba4c5a1f5ce8318aa7e8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 89233b76d7cf91b0977e78ec9b08fc12ddec28361da16db0fe84ea573e36fd49491515809ecd8ae1de583869974e5a123808dee98366bf0ce0ec6acd52e64402
|
|
7
|
+
data.tar.gz: 3e15d5f11c6407af7bd76cd11ac1978bd6fe663d9f72fb08e3f284f7138f8bc12454b3a46f0e3341d8f3c4132e4849e040a09b296708cef1ea16b63659aacf68
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [7.1.3] - 2026-02-13
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Publish recovery for transient JetStream context loss** - `JetstreamBridge.publish` now catches `ConnectionNotEstablishedError`, performs a reconnect, and retries once so publish calls no longer fail immediately during brief JetStream context refresh windows.
|
|
13
|
+
- **Initialized-but-stale connection recovery** - Internal `connect_if_needed!` now validates that a JetStream context is actually available (not just that startup previously ran) and triggers reconnect when context refresh is pending or failed.
|
|
14
|
+
|
|
8
15
|
## [7.1.2] - 2026-02-11
|
|
9
16
|
|
|
10
17
|
### Fixed
|
|
@@ -14,9 +14,24 @@ module JetstreamBridge
|
|
|
14
14
|
# Automatically connects on first use if not already connected
|
|
15
15
|
# Thread-safe and idempotent
|
|
16
16
|
def connect_if_needed!
|
|
17
|
-
|
|
17
|
+
unless @connection_initialized
|
|
18
|
+
startup!
|
|
19
|
+
return
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
return if Connection.jetstream
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
Logging.warn(
|
|
25
|
+
'JetStream context unavailable on initialized connection. Attempting reconnect before operation.',
|
|
26
|
+
tag: 'JetstreamBridge'
|
|
27
|
+
)
|
|
28
|
+
reconnect!
|
|
29
|
+
rescue ConnectionNotEstablishedError
|
|
30
|
+
Logging.warn(
|
|
31
|
+
'JetStream context unavailable on initialized connection. Attempting reconnect before operation.',
|
|
32
|
+
tag: 'JetstreamBridge'
|
|
33
|
+
)
|
|
34
|
+
reconnect!
|
|
20
35
|
end
|
|
21
36
|
|
|
22
37
|
# Enforce rate limit on uncached health checks to prevent abuse
|
data/lib/jetstream_bridge.rb
CHANGED
|
@@ -322,10 +322,21 @@ module JetstreamBridge
|
|
|
322
322
|
# logger.error("Publish failed: #{result.error}")
|
|
323
323
|
# end
|
|
324
324
|
def publish(event_or_hash = nil, resource_type: nil, event_type: nil, payload: nil, subject: nil, **)
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
retried_after_reconnect = false
|
|
326
|
+
begin
|
|
327
|
+
connect_if_needed!
|
|
328
|
+
publisher = Publisher.new
|
|
329
|
+
publisher.publish(event_or_hash, resource_type: resource_type, event_type: event_type, payload: payload,
|
|
330
|
+
subject: subject, **)
|
|
331
|
+
rescue ConnectionNotEstablishedError => e
|
|
332
|
+
raise if retried_after_reconnect
|
|
333
|
+
|
|
334
|
+
retried_after_reconnect = true
|
|
335
|
+
Logging.warn("JetStream context unavailable during publish: #{e.message}. Reconnecting and retrying once.",
|
|
336
|
+
tag: 'JetstreamBridge')
|
|
337
|
+
reconnect!
|
|
338
|
+
retry
|
|
339
|
+
end
|
|
329
340
|
end
|
|
330
341
|
|
|
331
342
|
# Publish variant that raises on error
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jetstream_bridge
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.1.
|
|
4
|
+
version: 7.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Attara
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|