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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f742aa0ca8db65f9db9c6b5a135ae7d926fdf57dffde8d1d011ae3449298d32
4
- data.tar.gz: e7b3df1d90a904e8c2383a03d3231c0ff7398b4f269632d697c5d728c42c386a
3
+ metadata.gz: 8dd9b609e2bdb00f81b4b7dc54d47460a9a2d687c51870331459fbbf9019542e
4
+ data.tar.gz: 33a57685d7ae26719a1aba2871e84fc0cce87159bdf741664dc8169badb5ee5f
5
5
  SHA512:
6
- metadata.gz: b9cb75b00f87e29843b6837051100d1cac96448ab6db77a048837303b62cd98d18a1ab7dac1bd1f25a8f527b17cf644f2dab6ef46a4a62cf7edc88f1b02d71fd
7
- data.tar.gz: f409e09011d0492ccf0ea168ac6f89129ee6fcb83431617a5560ea977c1872a4346586996679538db4b14ea3ae50396d95d47df42f4626f77fff59cd3a00d804
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
  }
@@ -1,5 +1,5 @@
1
1
  module Dispatch
2
2
  module Rails
3
- VERSION = "0.10.2".freeze
3
+ VERSION = "0.10.3".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dispatch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dispatch Team