Skip to content

HF-131 (3/7): a consumer can tell 'no message' from 'empty message' - #1763

Open
marcin-kordas-hoc wants to merge 10 commits into
feat/hf-131-error-messages-outside-interpreterfrom
feat/hf-131-has-message
Open

marcin-kordas-hoc wants to merge 10 commits into
feat/hf-131-error-messages-outside-interpreterfrom
feat/hf-131-has-message

Conversation

@marcin-kordas-hoc

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

Copy link
Copy Markdown
Collaborator

Context

The PR adds DetailedCellError.hasMessage, so a consumer can tell an error with no message from one with an empty message. It is part 3 of 7 of HF-131, stacked on #1762.

  • Why: DetailedCellError.message is '' both when the error had no message and when the message was deliberately empty. A custom function may omit the message, because the CellError constructor keeps it optional.
  • What changed:
    • hyperformula/src/CellValue.ts: hasMessage is true when the underlying CellError has a message, even an empty one.
    • docs/guide/custom-functions.md: one paragraph on message and hasMessage.
    • hyperformula/test/_setupFiles/matchers/cellErrorComparison.ts: toEqualError ignores the new field.
  • Result: =1/0 reports hasMessage: true; an error value typed into a cell reports hasMessage: false and message: ''.

How did you test your changes?

Compatibility with Excel and Google Sheets

Not applicable: no formula result changes.

Public API changes

  • DetailedCellError.hasMessage: boolean (new, read-only). toString() and valueOf() are unchanged.

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. Part of Improve the formula error messages #1547 (HF-131).

Checklist

After Tasks 1-2 no engine-produced cell error is message-less, but a custom
function may still return new CellError('VALUE') with no message -- the
documented, still-supported contract. Both cases used to surface identically
as message: ''. DetailedCellError.hasMessage (own enumerable, readonly)
tells them apart: true means a message was set, even a deliberately empty
one; false means none was.

test/_setupFiles/matchers/cellErrorComparison.ts already exists as the
single shared strip-list both toEqualError implementations import (built
during the origin-mechanism work, ahead of this task) -- extended with one
line rather than introducing the second shared-file layout the original
plan draft described, since duplicating the consolidation this task already
has would reopen the exact drift risk that shared module exists to close.

Verified the strip-list entry is load-bearing empirically, not by trusting
the plan's synthetic probe: removing 'hasMessage: undefined' from the list
and running the full suite produces 446 failures; restoring it returns to
baseline.

docs/guide/custom-functions.md gains the note this field's own PR owes it,
per the plan's explicit instruction not to defer a field's documentation to
a later task.

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

qunabu commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@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.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 07bbd58. 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 9d436c4 Commit Preview URL

Branch Preview URL
Oct 23 2026, 07:17 AM

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Performance comparison of head (9d436c4) vs base (c5feea6)

                                     testName |   base |    head | change
-------------------------------------------------------------------------
                                      Sheet A | 503.52 |  500.85 | -0.53%
                                      Sheet B | 166.25 |  161.39 | -2.92%
                                      Sheet T |  143.9 |  141.35 | -1.77%
                                Column ranges |  535.1 |  530.38 | -0.88%
                                Sorted lookup |  15218 | 15134.7 | -0.55%
Sheet A:  change value, add/remove row/column |  19.75 |   18.72 | -5.22%
 Sheet B: change value, add/remove row/column | 145.69 |  152.53 | +4.69%
                   Column ranges - add column | 168.37 |  168.56 | +0.11%
                Column ranges - without batch | 530.13 |  509.74 | -3.85%
                        Column ranges - batch | 129.87 |  128.64 | -0.95%

marcin-kordas-hoc and others added 7 commits September 11, 2026 03:22
The JSDoc and the custom-functions guide both said a false hasMessage means the
error came from a custom function. An error value typed straight into a cell also
has no message, and reports originFunction 'user input'.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitHub #131 is an unrelated, closed issue; this work is tracked by #1547.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…at/hf-131-has-message

# Conflicts:
#	test/_setupFiles/matchers/cellErrorComparison.ts

@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.

Looks good. Verified that hasMessage distinguishes an omitted message from an explicitly empty string, including through cell references.

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.34%. Comparing base (c5feea6) to head (9d436c4).

Additional details and impacted files

Impacted file tree graph

@@                               Coverage Diff                               @@
##           feat/hf-131-error-messages-outside-interpreter    #1763   +/-   ##
===============================================================================
  Coverage                                           97.34%   97.34%           
===============================================================================
  Files                                                 207      207           
  Lines                                               16322    16323    +1     
  Branches                                             3621     3621           
===============================================================================
+ Hits                                                15889    15890    +1     
  Misses                                                425      425           
  Partials                                                8        8           
Files with missing lines Coverage Δ
hyperformula/src/CellValue.ts 80.00% <100.00%> (+2.22%) ⬆️
🚀 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