Skip to content

HF-131 (6/7): thrown exceptions name the cell (issue #444) - #1766

Open
marcin-kordas-hoc wants to merge 16 commits into
fix/hf-131-rootless-originfrom
fix/hf-131-issue-444-addresses
Open

marcin-kordas-hoc wants to merge 16 commits into
fix/hf-131-rootless-originfrom
fix/hf-131-issue-444-addresses

Conversation

@marcin-kordas-hoc

@marcin-kordas-hoc marcin-kordas-hoc commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Context

The PR makes the error thrown for a formula cell read before it was computed name that cell. It is part 6 of 7 of HF-131, stacked on #1765, and fixes #444.

  • Why: the engine threw a plain Error('Value of the formula cell is not computed.') or Error('Array not computed yet.'), with no way to tell which cell it was.
  • What changed:
    • hyperformula/src/errors.ts: CellValueNotComputedError with a read-only address and the address in its message.
    • hyperformula/src/DependencyGraph/FormulaVertex.ts: the scalar and array formula vertices throw it.
    • hyperformula/src/index.ts: exported by name and as HyperFormula.CellValueNotComputedError.
  • Result: the thrown error is instanceof CellValueNotComputedError and instanceof Error, and its message reads Value of the formula cell (sheet = 0, row = 0, col = 0) is not computed.

How did you test your changes?

  • Paired tests: handsontable/hyperformula-tests#64 on fix/hf-131-issue-444-addresses, with the new unit/errors.spec.ts (4 tests, both vertex types).
  • That spec passes against this head and fails against HF-131 (5/7): no error reports a cell that did not produce it #1765's head.
  • CI is green on this head, except the repository-wide FOSSA license check.

Compatibility with Excel and Google Sheets

Not applicable: no formula result changes.

Public API changes

  • New exported class CellValueNotComputedError (also HyperFormula.CellValueNotComputedError).
  • The message of this thrown error changes. Code that matched the old message text needs to match the class instead.

Out of scope and follow-ups

None.

Types of changes

  • Breaking change (existing functionality no longer works as before) – agreed with the maintainers
  • New feature or improvement (a non-breaking change that adds functionality)
  • Bug fix (a non-breaking change that fixes an issue)
  • Additional language file, or a change to an existing language file (translations)
  • Change to the documentation

Related issues

  1. Fixes Add cellAddress to "Value of the formula cell is not computed." error message #444.
  2. Part of Improve the formula error messages #1547 (HF-131).

Checklist

Reading a formula cell's value before it has been computed used to throw a
bare Error with no way to identify which cell caused it — the literal
complaint in issue #444, open since 2020-07-07. Both vertex classes that can
throw this (ScalarFormulaVertex and ArrayFormulaVertex, sibling classes in
the same file) had the identical defect.

CellValueNotComputedError carries the address as a field rather than only in
prose, and is re-exported from the package (import block, HyperFormulaNS
static, and the bottom export block in src/index.ts) so a consumer can catch
it by type, not just by parsing the message.

The message itself interpolates numeric sheet/row/col rather than A1-style
notation: neither vertex class has access to the sheetIndexMapping that
A1-conversion requires, so the field is the deliverable, not the prose.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@qunabu

qunabu commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@marcin-kordas-hoc marcin-kordas-hoc mentioned this pull request Sep 10, 2026
7 of 12 tasks

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit da37522. Configure here.

Comment thread CHANGELOG.md Outdated
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hyperformula-docs a95916b Commit Preview URL

Branch Preview URL
Oct 23 2026, 07:21 AM

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Performance comparison of head (a95916b) vs base (ae97e21)

                                     testName |    base |    head | change
--------------------------------------------------------------------------
                                      Sheet A |  515.87 |   508.1 | -1.51%
                                      Sheet B |  168.92 |  166.35 | -1.52%
                                      Sheet T |  150.14 |  145.26 | -3.25%
                                Column ranges |  488.25 |  475.04 | -2.71%
                                Sorted lookup | 14706.8 | 13886.1 | -5.58%
Sheet A:  change value, add/remove row/column |    16.3 |   16.46 | +0.98%
 Sheet B: change value, add/remove row/column |  141.84 |  133.07 | -6.18%
                   Column ranges - add column |  160.33 |  152.32 | -5.00%
                Column ranges - without batch |  490.06 |   465.7 | -4.97%
                        Column ranges - batch |  123.45 |  115.09 | -6.77%

@Tobiadefami Tobiadefami left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks good.

@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.40%. Comparing base (ae97e21) to head (a95916b).

Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                       @@
##           fix/hf-131-rootless-origin    #1766      +/-   ##
==============================================================
+ Coverage                       97.38%   97.40%   +0.01%     
==============================================================
  Files                             207      207              
  Lines                           16343    16349       +6     
  Branches                         3630     3630              
==============================================================
+ Hits                            15916    15925       +9     
+ Misses                            419      416       -3     
  Partials                            8        8              
Files with missing lines Coverage Δ
hyperformula/src/DependencyGraph/FormulaVertex.ts 86.71% <100.00%> (+2.46%) ⬆️
hyperformula/src/errors.ts 100.00% <100.00%> (ø)
hyperformula/src/index.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants