rails-profiler 0.44.17 → 0.44.18
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 +8 -0
- data/app/assets/javascript/profiler-ajax-interceptor.js +15 -5
- data/lib/profiler/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: 136fdd7fd5d34a66aa87bd01e8cd55b2df26c3de03c988a733bade1a44a3034d
|
|
4
|
+
data.tar.gz: dd962de06e0747beb03bc6bee76d411a1bdf2c22c382991af55e977983119889
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d96275cf8138715c6751b52e65c825d8afe8dd9c2e78615a2afd95e292b9eda8510998b90289f0758857cc47b9b2f0b7b4e2a1153ec01249f0612ed86e8837d5
|
|
7
|
+
data.tar.gz: 454845b2440625265337ade6fbf70a1b19dafe456d625654a5ad65c9702ce798c5ffba6297cf1475e1264024cfc6976a6b62679728e5e5c0a5bdcbb54a85fae3
|
data/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,14 @@ every commit of every tag interval is accounted for one way or the other.
|
|
|
19
19
|
|
|
20
20
|
## [Unreleased]
|
|
21
21
|
|
|
22
|
+
## [0.44.18] - 2026-10-25
|
|
23
|
+
|
|
24
|
+
<!-- stamped -->
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **AJAX interceptor:** Retry `/_profiler/api/ajax/link` with exponential backoff (100ms, 200ms, 400ms) on 404 errors, bounded to 3 attempts, to handle streaming response profiles not yet persisted when the client attachment request arrives. Refs #70
|
|
29
|
+
|
|
22
30
|
## [0.44.17] - 2026-10-25
|
|
23
31
|
|
|
24
32
|
<!-- stamped -->
|
|
@@ -91,20 +91,20 @@
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
// Helper function to link child profile to parent
|
|
95
|
-
function linkChildProfile(childToken) {
|
|
94
|
+
// Helper function to link child profile to parent, with retry on 404
|
|
95
|
+
function linkChildProfile(childToken, attempt = 1) {
|
|
96
96
|
const parentToken = currentParentToken();
|
|
97
97
|
if (!childToken || !parentToken) return;
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
// Post to the link API endpoint
|
|
99
|
+
const maxAttempts = 3;
|
|
102
100
|
const linkUrl = '/_profiler/api/ajax/link';
|
|
103
101
|
const body = JSON.stringify({
|
|
104
102
|
parent_token: parentToken,
|
|
105
103
|
child_token: childToken
|
|
106
104
|
});
|
|
107
105
|
|
|
106
|
+
console.debug('[Profiler] Linking AJAX request:', { parent: parentToken, child: childToken, attempt });
|
|
107
|
+
|
|
108
108
|
// Use original fetch to avoid infinite loop
|
|
109
109
|
originalFetch.call(window, linkUrl, {
|
|
110
110
|
method: 'POST',
|
|
@@ -122,6 +122,16 @@
|
|
|
122
122
|
window.__PROFILER_REFRESH_TOOLBAR__();
|
|
123
123
|
}
|
|
124
124
|
}, 100);
|
|
125
|
+
} else if (response.status === 404 && attempt < maxAttempts) {
|
|
126
|
+
// Profile not yet persisted (streaming response case): retry with exponential backoff
|
|
127
|
+
const backoffMs = 100 * Math.pow(2, attempt - 1); // 100ms, 200ms, 400ms
|
|
128
|
+
console.debug('[Profiler] Profile not found (404), retrying in', backoffMs, 'ms');
|
|
129
|
+
setTimeout(() => {
|
|
130
|
+
linkChildProfile(childToken, attempt + 1);
|
|
131
|
+
}, backoffMs);
|
|
132
|
+
} else if (response.status === 404) {
|
|
133
|
+
// Exhausted retries
|
|
134
|
+
console.debug('[Profiler] Profile not found after', maxAttempts, 'retries, giving up');
|
|
125
135
|
}
|
|
126
136
|
}).catch(err => {
|
|
127
137
|
// Fail silently - don't break the page if profiler API fails
|
data/lib/profiler/version.rb
CHANGED