dispatch-rails 0.10.2 → 0.10.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 +12 -0
- data/app/assets/javascripts/dispatch/error_tracker.js +9 -1
- data/lib/dispatch/rails/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: 8dd9b609e2bdb00f81b4b7dc54d47460a9a2d687c51870331459fbbf9019542e
|
|
4
|
+
data.tar.gz: 33a57685d7ae26719a1aba2871e84fc0cce87159bdf741664dc8169badb5ee5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d33ec2cc1b41aeb2f1f563c819f91272e8ea3f983b6c9ca638ca152ac9e532014e8b22a5e66d9b947c11506f189d8e6c4f747b6332e8aca08b5d3b5a6422d5f
|
|
7
|
+
data.tar.gz: 12985b909215d106a6bcda904d031758f276b8f4c8fb766e58f66a6e3672e87d7bdd82951b962389a5bf8877ed4b2706ff88d36aebdb7e1dddd8a195d3b2fa66
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to `dispatch-rails` are documented here. The format is based
|
|
|
4
4
|
on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
|
|
5
5
|
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.10.3] - 2026-07-08
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- The browser error tracker could **report on its own transport failures**. The
|
|
11
|
+
`send()` fetch had no rejection handler, so a failed report (flaky connection,
|
|
12
|
+
a blocked or CORS-less endpoint response) surfaced as an `unhandledrejection` —
|
|
13
|
+
which the tracker's own listener then reported via `send()`, firing another
|
|
14
|
+
fetch at the same failing endpoint. Hosts saw a `TypeError: Failed to fetch`
|
|
15
|
+
attributed to `error_tracker.js#send`, and a reachable-but-erroring endpoint
|
|
16
|
+
could turn it into a self-amplifying loop. The `fetch` now has a `.catch` that
|
|
17
|
+
swallows transport failures, so the tracker never reports on its own delivery.
|
|
18
|
+
|
|
7
19
|
## [0.10.2] - 2026-06-18
|
|
8
20
|
|
|
9
21
|
### Fixed
|
|
@@ -156,11 +156,19 @@
|
|
|
156
156
|
// Preferred: fetch keepalive (proper CORS + Authorization header).
|
|
157
157
|
if (window.fetch) {
|
|
158
158
|
try {
|
|
159
|
+
// The .catch is essential: fetch reports network/CORS failures as a
|
|
160
|
+
// REJECTED PROMISE, not a synchronous throw. Without it, a failed report
|
|
161
|
+
// (flaky connection, blocked endpoint, CORS-less error response) becomes
|
|
162
|
+
// an unhandledrejection — which our own listener below reports via send(),
|
|
163
|
+
// firing another fetch at the same failing endpoint. That self-reporting
|
|
164
|
+
// loop is exactly what "TypeError: Failed to fetch" at send() means.
|
|
165
|
+
// Swallow transport failures silently; the tracker must never report on
|
|
166
|
+
// its own transport.
|
|
159
167
|
fetch(cfg.endpoint, {
|
|
160
168
|
method: "POST", keepalive: true, mode: "cors",
|
|
161
169
|
headers: { "Content-Type": "application/json", "Authorization": "Bearer " + cfg.apiKey },
|
|
162
170
|
body: body
|
|
163
|
-
});
|
|
171
|
+
}).catch(function () { /* transport failed; never self-report */ });
|
|
164
172
|
return;
|
|
165
173
|
} catch (e) { /* fall through */ }
|
|
166
174
|
}
|