@autobusal/providers 1.28.0 → 1.28.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.
- package/CHANGELOG.md +16 -0
- package/Setup/staleChunk.ts +18 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.28.1
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **The stale-chunk guard budgeted two reloads instead of one.** Measured: a
|
|
8
|
+
failure at `/operators` reloaded, the server answered with its canonical
|
|
9
|
+
`/operators/`, the same chunk failed again — and the raw path no longer
|
|
10
|
+
matched the one already spent, so it reloaded a second time. Bounded, but
|
|
11
|
+
twice what was intended, and on a genuinely broken deploy the user watched
|
|
12
|
+
the page flash twice before the error appeared. The budget key now strips a
|
|
13
|
+
trailing slash, so one journey gets one reload.
|
|
14
|
+
|
|
15
|
+
Only visible because the retest ran against a chunk that was *permanently*
|
|
16
|
+
missing rather than replaced — the ordinary stale-bundle case recovers on
|
|
17
|
+
the first reload and never reaches the second.
|
|
18
|
+
|
|
3
19
|
## 1.28.0
|
|
4
20
|
|
|
5
21
|
### Added
|
package/Setup/staleChunk.ts
CHANGED
|
@@ -32,6 +32,23 @@
|
|
|
32
32
|
|
|
33
33
|
const KEY = 'chunk-reload';
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* The key a reload is budgeted against.
|
|
37
|
+
*
|
|
38
|
+
* Ferjolt Ozuni - Date: 2026-08-06
|
|
39
|
+
* TRAILING SLASH STRIPPED, and that is not tidiness. Measured: a failure at
|
|
40
|
+
* `/operators` reloaded, the server answered with its canonical `/operators/`,
|
|
41
|
+
* the same chunk failed again - and the raw path no longer matched the one
|
|
42
|
+
* already spent, so it reloaded a SECOND time. Bounded, but twice what was
|
|
43
|
+
* intended, and on a genuinely broken deploy the user watches the page flash
|
|
44
|
+
* twice before the error appears. One journey, one budget.
|
|
45
|
+
*/
|
|
46
|
+
const budgetKey = (): string => {
|
|
47
|
+
const path = window.location.pathname.replace(/\/+$/, '') || '/';
|
|
48
|
+
|
|
49
|
+
return path + window.location.search;
|
|
50
|
+
};
|
|
51
|
+
|
|
35
52
|
/**
|
|
36
53
|
* Which paths this tab has already spent its reload on.
|
|
37
54
|
*/
|
|
@@ -78,9 +95,7 @@ const remember = (path: string): boolean => {
|
|
|
78
95
|
*/
|
|
79
96
|
const registerStaleChunkRecovery = (): void => {
|
|
80
97
|
window.addEventListener('vite:preloadError', (event) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (!remember(path)) {
|
|
98
|
+
if (!remember(budgetKey())) {
|
|
84
99
|
// Spent already. Let it throw so the error boundary says something,
|
|
85
100
|
// rather than reloading into the same wall a second time.
|
|
86
101
|
return;
|