@uniweb/core 0.8.2 → 0.8.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/core",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
@@ -35,8 +35,8 @@
35
35
  "vitest": "^4.1.7"
36
36
  },
37
37
  "dependencies": {
38
- "@uniweb/theming": "0.1.15",
39
- "@uniweb/semantic-parser": "1.2.1"
38
+ "@uniweb/theming": "^0.1.15",
39
+ "@uniweb/semantic-parser": "^1.2.1"
40
40
  },
41
41
  "scripts": {
42
42
  "test": "vitest run"
@@ -227,8 +227,22 @@ export default class FetcherDispatcher {
227
227
  const cached = this._dataStore.get(key)
228
228
  if (cached) return { data: cached.data, meta: cached.meta }
229
229
 
230
+ // An in-flight entry whose master has ALREADY aborted is a corpse: its
231
+ // underlying request is cancelled and its promise will settle to
232
+ // `{ data: [], error: 'aborted' }`. Attaching to it would hand this caller
233
+ // a cancelled result it never asked to cancel — `_attachSignal` has no way
234
+ // to re-arm a fired master. Treat it as a miss and start a fresh fetch.
235
+ //
236
+ // This is the sequential counterpart to the refcounting below. Refcounting
237
+ // covers CONCURRENT waiters (B attaches before A aborts, so the master
238
+ // stays live). It cannot cover SEQUENTIAL ones (A aborts, then B arrives),
239
+ // which is exactly React StrictMode's dev double-mount: the cleanup and the
240
+ // re-run happen in one synchronous commit, so B always lands in the window
241
+ // after the abort and before `_runFetcher`'s continuation clears the entry.
242
+ // Without this check the second mount inherits the first mount's abort and
243
+ // the block renders empty data — see tests/fetcher-dispatcher.test.js.
230
244
  const existing = this._dataStore.inflight.get(key)
231
- if (existing) {
245
+ if (existing && !existing.master?.signal.aborted) {
232
246
  this._attachSignal(existing, ctx.signal)
233
247
  return existing.promise
234
248
  }