Skip to content

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

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

marcin-kordas-hoc wants to merge 8 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

What and why

Stacked on #1762. Adds DetailedCellError.hasMessage: boolean.

DetailedCellError.message collapses two different situations into the same '': an error that
never carried a message at all (e.g. a custom function that omitted one — the public CellError
constructor keeps message optional), and an error with a deliberately empty message. A consumer
that needs to tell them apart previously couldn't. hasMessage does: true means a message was
set (even an empty string), false means none was.

Purely additive — no existing consumer of .type/.message/.value/.address needs a code
change. toString()/valueOf() are unaffected (both still return .value only).

Verified

Stack

3 of 7 — stacked on #1762. Next: feat/hf-131-origin-function.

🤖 Generated with Claude Code


Note

Low Risk
Additive public field on DetailedCellError with no changes to existing error string behavior or required consumer updates.

Overview
Adds DetailedCellError.hasMessage so callers can distinguish an error that never had a message from one with a deliberately empty string — both still expose message as ''.

The flag is set in the DetailedCellError constructor from whether the underlying CellError had message defined (hasMessage: error.message !== undefined). Existing .type, .message, .value, and .address behavior is unchanged; toString() / valueOf() still return only .value.

CHANGELOG documents the addition; custom-functions docs explain optional custom CellError messages vs engine errors. Test toEqualError structural comparison ignores hasMessage like other metadata fields.

Reviewed by Cursor Bugbot for commit 915ca17. Bugbot is set up for automated code reviews on this repo. Configure here.

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 915ca17 Commit Preview URL

Branch Preview URL
Sep 14 2026, 10:36 AM

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

Performance comparison of head (915ca17) vs base (d8cd6cf)

                                     testName |    base |    head | change
--------------------------------------------------------------------------
                                      Sheet A |  391.06 |  395.31 | +1.09%
                                      Sheet B |  128.68 |  125.96 | -2.11%
                                      Sheet T |  110.19 |  109.19 | -0.91%
                                Column ranges |  412.38 |  412.62 | +0.06%
                                Sorted lookup | 12369.4 | 12019.9 | -2.83%
Sheet A:  change value, add/remove row/column |    13.3 |   13.29 | -0.08%
 Sheet B: change value, add/remove row/column |  115.95 |  110.09 | -5.05%
                   Column ranges - add column |  130.07 |  129.95 | -0.09%
                Column ranges - without batch |  415.86 |  415.26 | -0.14%
                        Column ranges - batch |  103.19 |  104.21 | +0.99%

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

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.39%. Comparing base (d8cd6cf) to head (915ca17).

Additional details and impacted files

Impacted file tree graph

@@                               Coverage Diff                               @@
##           feat/hf-131-error-messages-outside-interpreter    #1763   +/-   ##
===============================================================================
  Coverage                                           97.39%   97.39%           
===============================================================================
  Files                                                 195      195           
  Lines                                               15843    15844    +1     
  Branches                                             3494     3494           
===============================================================================
+ Hits                                                15430    15431    +1     
  Misses                                                405      405           
  Partials                                                8        8           
Files with missing lines Coverage Δ
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.

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.

2 participants