|
diff --git a/dist/dev-shared.js b/dist/dev-shared.js |
|
index cd854aeccb9b0d6cc184e17c5f23783901ec783f..97081c824986a709ad3491344a86ba566bb46427 100644 |
|
--- a/dist/dev-shared.js |
|
+++ b/dist/dev-shared.js |
|
@@ -3297,6 +3297,7 @@ function settlePendingSource(el, source = el) { |
|
// re-parks can retain an abandoned self entry (source === el), which must |
|
// retire in the same walk as its propagated copies. |
|
removePendingSource(el, source); |
|
+ if (!(el._statusFlags & (STATUS_PENDING | STATUS_ERROR))) el.fam?.st(0); |
|
let scheduled = false; |
|
let released; |
|
const visited = new NewSet(); |
|
@@ -3331,6 +3332,10 @@ function settlePendingSource(el, source = el) { |
|
} else { |
|
node._statusFlags &= ~STATUS_PENDING; |
|
if (!errored) setPendingError(node); |
|
+ // A projection may recover without re-running when its upstream lands |
|
+ // on the same value. Its leaves are not dependencies of the derive, so |
|
+ // explicitly release the readers that familyStatus parked on it. |
|
+ if (!errored) node.fam?.st(0); |
|
// L2: a landing resumes the transaction waiting on it (maintainer: "it |
|
// resumes the sync frame") — a held reader's re-pass over the landed |
|
// value is that transaction's work, and the flush that carries it |
|
diff --git a/dist/dev.js b/dist/dev.js |
|
index 0f4ccb08e3d7da1de2d6c747cc79e39237022704..c2109c1b5587680c9a679913dd70f841d1b0e454 100644 |
|
--- a/dist/dev.js |
|
+++ b/dist/dev.js |
|
@@ -6705,7 +6705,7 @@ function errorFamily(fam) { |
|
* settle — core's walk, from each leaf (the leaves are not the derive's |
|
* dependents, so its own settle walk does not reach them). */ |
|
function settleFamily(fam) { |
|
- if (!fam.woke) return; |
|
+ if (!fam.woke || fam.node._statusFlags & STATUS_PENDING) return; |
|
fam.woke = false; |
|
const fw = fam.node; |
|
forEachFamilyNode(fam, n => { |
|
@@ -6718,6 +6718,7 @@ function settleFamily(fam) { |
|
function familyStatus(status) { |
|
if (status & STATUS_PENDING) wakeFamily(this); |
|
else if (status & STATUS_ERROR) errorFamily(this); |
|
+ else settleFamily(this); |
|
} |
|
function forEachFamilyNode(fam, fn) { |
|
for (const t of fam.live) { |
|
diff --git a/dist/observe/core/async.js b/dist/observe/core/async.js |
|
index 04fab1ba5c7758b0c0543d8c7e5ac199f27b6fd2..b520db0266247a667694be1f40e7768a2720d203 100644 |
|
--- a/dist/observe/core/async.js |
|
+++ b/dist/observe/core/async.js |
|
@@ -190,6 +190,7 @@ function settlePendingSource(e, t = e) { |
|
// re-parks can retain an abandoned self entry (source === el), which must |
|
// retire in the same walk as its propagated copies. |
|
removePendingSource(e, t); |
|
+ if (!(e.m & (STATUS_PENDING | STATUS_ERROR))) e.fam?.st(0); |
|
let n = false; |
|
let r; |
|
const o = new NewSet; |
|
@@ -221,6 +222,8 @@ function settlePendingSource(e, t = e) { |
|
} else { |
|
s.m &= ~STATUS_PENDING; |
|
if (!u) setPendingError(s); |
|
+ // Release projection leaf readers on unchanged upstream recovery. |
|
+ if (!u) s.fam?.st(0); |
|
// L2: a landing resumes the transaction waiting on it (maintainer: "it |
|
// resumes the sync frame") — a held reader's re-pass over the landed |
|
// value is that transaction's work, and the flush that carries it |
|
diff --git a/dist/observe/store/projection.js b/dist/observe/store/projection.js |
|
index 6c0ceebad71d50e6721e193f3e7a20b133d967f2..acf5d8176dfbfa679bcd1460a37997668a281216 100644 |
|
--- a/dist/observe/store/projection.js |
|
+++ b/dist/observe/store/projection.js |
|
@@ -158,7 +158,7 @@ function cloneState(e, t) { |
|
/** The flight landed: the readers the wake left pending on the derive |
|
* settle — core's walk, from each leaf (the leaves are not the derive's |
|
* dependents, so its own settle walk does not reach them). */ function settleFamily(e) { |
|
- if (!e.woke) return; |
|
+ if (!e.woke || e.node.m & STATUS_PENDING) return; |
|
e.woke = false; |
|
const t = e.node; |
|
forEachFamilyNode(e, e => { |
|
@@ -169,7 +169,7 @@ function cloneState(e, t) { |
|
/** A source's status reached the derive by propagation (core |
|
* `propagateStatus`), its pass not re-run: the family learns it as from the |
|
* pass's own throw. */ function familyStatus(e) { |
|
- if (e & STATUS_PENDING) wakeFamily(this); else if (e & STATUS_ERROR) errorFamily(this); |
|
+ if (e & STATUS_PENDING) wakeFamily(this); else if (e & STATUS_ERROR) errorFamily(this); else settleFamily(this); |
|
} |
|
|
|
function forEachFamilyNode(e, t) { |
|
diff --git a/dist/prod/core/async.js b/dist/prod/core/async.js |
|
index 3ac5eccc96502c79347ba3f6ec27257faca2a639..52bf456836121fa83ba7af3f64917476511c180d 100644 |
|
--- a/dist/prod/core/async.js |
|
+++ b/dist/prod/core/async.js |
|
@@ -186,6 +186,7 @@ function settlePendingSource(e, n = e) { |
|
// re-parks can retain an abandoned self entry (source === el), which must |
|
// retire in the same walk as its propagated copies. |
|
removePendingSource(e, n); |
|
+ if (!(e.m & (STATUS_PENDING | STATUS_ERROR))) e.fam?.st(0); |
|
let t = false; |
|
let r; |
|
const o = new NewSet; |
|
@@ -217,6 +218,8 @@ function settlePendingSource(e, n = e) { |
|
} else { |
|
f.m &= ~STATUS_PENDING; |
|
if (!u) setPendingError(f); |
|
+ // Release projection leaf readers on unchanged upstream recovery. |
|
+ if (!u) f.fam?.st(0); |
|
// L2: a landing resumes the transaction waiting on it (maintainer: "it |
|
// resumes the sync frame") — a held reader's re-pass over the landed |
|
// value is that transaction's work, and the flush that carries it |
|
diff --git a/dist/prod/store/projection.js b/dist/prod/store/projection.js |
|
index 0f97e1a4f9280c291c875978c518db5a850cd098..c99586ea450ed9d66d31e6d4ae46bf5b9dbb7c65 100644 |
|
--- a/dist/prod/store/projection.js |
|
+++ b/dist/prod/store/projection.js |
|
@@ -156,7 +156,7 @@ function cloneState(e, t) { |
|
/** The flight landed: the readers the wake left pending on the derive |
|
* settle — core's walk, from each leaf (the leaves are not the derive's |
|
* dependents, so its own settle walk does not reach them). */ function settleFamily(e) { |
|
- if (!e.woke) return; |
|
+ if (!e.woke || e.node.m & STATUS_PENDING) return; |
|
e.woke = false; |
|
const t = e.node; |
|
forEachFamilyNode(e, e => { |
|
@@ -167,7 +167,7 @@ function cloneState(e, t) { |
|
/** A source's status reached the derive by propagation (core |
|
* `propagateStatus`), its pass not re-run: the family learns it as from the |
|
* pass's own throw. */ function familyStatus(e) { |
|
- if (e & STATUS_PENDING) wakeFamily(this); else if (e & STATUS_ERROR) errorFamily(this); |
|
+ if (e & STATUS_PENDING) wakeFamily(this); else if (e & STATUS_ERROR) errorFamily(this); else settleFamily(this); |
|
} |
|
|
|
function forEachFamilyNode(e, t) { |