Skip to content

Commit 3be1cee

Browse files
committed
fix(cache-clear): align preload slotKey with main pendingKey
Preload setServerBuildSignals collapsed sourceless+buildId signals into the cacheVersion-only slot, silently overwriting a real cacheVersion-only signal queued for the same URL. Main's pendingKey already separated the two cases. Add 'sourceless-buildId' to the SlotKey union and FLUSH_ORDER and route signals with buildId-but-no-source through it.
1 parent 31d3d3a commit 3be1cee

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/servers/preload/serverBuild.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ type BuildSignals = {
88
buildIdSource?: 'commit' | 'version' | 'autoupdate';
99
};
1010

11-
type SlotKey = 'commit' | 'version' | 'autoupdate' | 'cacheVersion-only';
11+
type SlotKey =
12+
| 'commit'
13+
| 'version'
14+
| 'autoupdate'
15+
| 'sourceless-buildId'
16+
| 'cacheVersion-only';
1217

1318
const FLUSH_ORDER: SlotKey[] = [
1419
'commit',
1520
'version',
1621
'autoupdate',
22+
'sourceless-buildId',
1723
'cacheVersion-only',
1824
];
1925
const RETRY_INTERVAL_MS = 250;
@@ -25,6 +31,7 @@ let storeReady = false;
2531
const slotKey = (signals: BuildSignals): SlotKey => {
2632
const { buildId, buildIdSource } = signals;
2733
if (buildId && buildIdSource) return buildIdSource;
34+
if (buildId) return 'sourceless-buildId';
2835
return 'cacheVersion-only';
2936
};
3037

0 commit comments

Comments
 (0)