Skip to content

docs: document TinyMath expression nesting and length limits (#7623) - #7676

Merged
florent-leborgne merged 4 commits into
mainfrom
docs-issue-7623-tinymath-limits
Jul 31, 2026
Merged

docs: document TinyMath expression nesting and length limits (#7623)#7676
florent-leborgne merged 4 commits into
mainfrom
docs-issue-7623-tinymath-limits

Conversation

@florent-leborgne

@florent-leborgne florent-leborgne commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

This PR addresses #7623 with the following change:

  • explore-analyze/visualize/canvas/canvas-tinymath-functions.md: Add a note to the page introduction documenting the two new hard input limits on TinyMath expressions — up to 20 levels of parenthesis nesting and up to 1,000 characters — with expressions exceeding either limit rejected before parsing.

These limits were added in elastic/kibana#276783 to the shared kbn-tinymath package. The performance fix itself needs no docs, but the limits are user-visible constraints that can reject previously accepted long or deeply nested formulas, and this is the only reference page describing TinyMath behavior.

The values are verified against the current source (MAX_NESTING_DEPTH = 20, MAX_EXPRESSION_LENGTH = 1000 in kbn-tinymath/src/index.js at HEAD).

Version scoping

Tagged stack: ga 9.4 and serverless: ga.

The fix was backported broadly (backport:all-open), but under the cumulative-docs convention that readers run the latest patch of a documented minor, only minors with the limits in an actually shipped release get a badge:

  • v9.3.9 was a backport target, not a release (9.3 ended at 9.3.8), so no real 9.3 build carries the limits.
  • 9.4.5 is the earliest shipped release that carries them, so 9.4 is the floor.
  • 9.0–9.2 never received the backport and sit below the tag, so they're correctly excluded.
  • 8.19.20 also carries the limits, but it's an isolated island below the 9.0–9.3 gap and can't be co-expressed with 9.4+ in a single monotonic tag. Given this is a defensive input limit, leaving the trailing 8.x uncovered is an acceptable trade.

Resolves

Closes #7623


AI-generated draft — created with Claude.
Review all generated content for factual accuracy before merging.

@github-actions

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

  • Review docs changes (docs-review). Status: not started.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

@mdbirnstiehl mdbirnstiehl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@florent-leborgne
florent-leborgne enabled auto-merge (squash) July 31, 2026 14:09
@florent-leborgne
florent-leborgne merged commit 6dbbd26 into main Jul 31, 2026
7 checks passed
@florent-leborgne
florent-leborgne deleted the docs-issue-7623-tinymath-limits branch July 31, 2026 14:11
florent-leborgne added a commit to elastic/kibana that referenced this pull request Jul 31, 2026
…#282035)

## Summary

Documents the two new hard input limits on TinyMath expressions in the
8.19 Canvas function reference: up to 20 levels of parenthesis nesting
and up to 1,000 characters, with expressions exceeding either limit
rejected before parsing.

This is the 8.19 (AsciiDoc) companion to the V3 docs update in
elastic/docs-content#7676. On the `8.19` branch the TinyMath reference
is still the legacy AsciiDoc, so the docs-content change (scoped `stack:
ga 9.4`) does not reach 8.19 readers.

The limits shipped in the `kbn-tinymath` package via
#276783 (`backport:all-open`) and are present on the
`8.19` branch: `MAX_NESTING_DEPTH = 20` and `MAX_EXPRESSION_LENGTH =
1000` in `src/platform/packages/private/kbn-tinymath/src/index.js`,
checked before parsing. Per the issue availability table, the fix ships
to users in 8.19.20.

- **`docs/canvas/canvas-tinymath-functions.asciidoc`**: Add a note to
the page introduction stating the nesting-depth and length limits.

## Related

- V3 companion: elastic/docs-content#7676
- Docs issue: elastic/docs-content#7623
- Implementation: #276783

## Labels needed

Docs-only backport to the 8.19 branch. Please add `release_note:skip`
and the `v8.19.20` version label on merge.

---

> **AI-generated draft** — created with Claude.
> Review all generated content for factual accuracy before merging.
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.

Formula expressions now enforce limits on nesting depth and expression length

2 participants