Deploy AIOS web (React glide grid + FastAPI slice)
Browse files- RELEASES.json +1 -1
- VERSION +1 -1
- web/src/sheet/formulaEval.ts +21 -1
RELEASES.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"current": "
|
| 3 |
"releases": []
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"current": "1f87e03",
|
| 3 |
"releases": []
|
| 4 |
}
|
VERSION
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
1f87e03
|
web/src/sheet/formulaEval.ts
CHANGED
|
@@ -2454,7 +2454,27 @@ export const evaluateCompiledSheetFormula = (
|
|
| 2454 |
const reason = err.message;
|
| 2455 |
return { kind: "unsupported", reason };
|
| 2456 |
}
|
| 2457 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2458 |
return { kind: "error", message: "This formula could not be calculated." };
|
| 2459 |
}
|
| 2460 |
};
|
|
|
|
| 2454 |
const reason = err.message;
|
| 2455 |
return { kind: "unsupported", reason };
|
| 2456 |
}
|
| 2457 |
+
// ⭐⭐ W61-T05 / THE COMBINE — AN ERROR LEAVES BY THIS DOOR WITH ITS CODE TOO.
|
| 2458 |
+
// `err.source` is the ORIGINAL error cell, kept because it carries what `errorValue` cannot
|
| 2459 |
+
// reconstruct: a cycle's `origin`, `via` and `path`. But a source cell may hold its code only
|
| 2460 |
+
// inside its MESSAGE ("#DIV/0! This formula divides by zero.") with no `code` member, and
|
| 2461 |
+
// returning it verbatim then loses the code the reader is supposed to see in the cell.
|
| 2462 |
+
// ⛔ THE ASYMMETRY IS THE BUG, and it is older than this wave: the sibling catch above (the
|
| 2463 |
+
// simple-range path) has always returned `errorValue(err.message)`, which PARSES the code out
|
| 2464 |
+
// of the message, so `=SUM(A1:A3)`, `=MIN(...)` and `=MAX(...)` over an error answered
|
| 2465 |
+
// `{code: "#DIV/0!"}` while `=AVERAGE(...)` — the one user-facing aggregate that reaches the
|
| 2466 |
+
// AST path rather than the fast one — answered the same error with no code at all.
|
| 2467 |
+
// W61-T05 added the AVERAGE leg that finally asked, and the lanes never saw it fail because
|
| 2468 |
+
// the gate was aborting on a wall-clock budget before that section.
|
| 2469 |
+
// ⚠ The code is FILLED IN, never overwritten: a source that already states one keeps it, and
|
| 2470 |
+
// every other member of the source cell survives.
|
| 2471 |
+
if (err instanceof FormulaError) {
|
| 2472 |
+
const source = err.source;
|
| 2473 |
+
if (!source) return errorValue(err.message);
|
| 2474 |
+
if (source.code) return source;
|
| 2475 |
+
const parsed = errorValue(source.message);
|
| 2476 |
+
return parsed.kind === "error" && parsed.code ? { ...source, code: parsed.code } : source;
|
| 2477 |
+
}
|
| 2478 |
return { kind: "error", message: "This formula could not be calculated." };
|
| 2479 |
}
|
| 2480 |
};
|