Skip to content

Fix state metadata example - #525

Merged
davidkpiano merged 2 commits into
mainfrom
feature/fix-state-meta
Nov 10, 2026
Merged

davidkpiano merged 2 commits into
mainfrom
feature/fix-state-meta

Conversation

@davidkpiano

@davidkpiano davidkpiano commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Use getMeta() to read metadata from active state nodes in both the state metadata example and the state snapshot overview. This carries forward the correction proposed in #416.

Validation

  • Ran both snapshot examples against XState and checked their metadata.
  • git diff --check

@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 10, 2026 4:23pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The finite-state guide now describes getMeta() as the method for retrieving metadata from active state nodes. Its example uses getMeta() instead of the snapshot’s .meta property.

Changes: Finite-state metadata documentation

Layer / File(s) Summary
Document metadata retrieval
content/docs/finite-states.mdx
The guide describes getMeta() as returning a node-ID-to-metadata mapping. The example now calls getMeta() instead of reading .meta.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: Minimal · up to 4c5af

The example uses getMeta(); no merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the documentation change to the state metadata example.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bf385c97-ce8a-46b0-9f7b-b81b87817cae
Commits

Reviewing files that changed from the base of the PR and between 9e334d5 and 4c5af0e.

Files selected for processing: 1

  • content/docs/finite-states.mdx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Devin Review

Meta data is static data that describes relevant properties of a state node. You can specify meta data on the `.meta` property of any state node. This can be useful for displaying information about a state node in a UI, or for generating documentation.

The `state.meta` property collects the `.meta` data from all active state nodes and places them in an object with the state node's ID as the key and the `.meta` data as the value:
The snapshot's `getMeta()` method returns the `.meta` data from all active state nodes. The returned object maps each state node's ID to its metadata:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 State overview still shows old metadata property

The state object overview still presents meta as a snapshot property. Readers following that example encounter the outdated API despite this correction.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@davidkpiano
davidkpiano merged commit 42bcc56 into main Nov 10, 2026
3 checks passed
@davidkpiano
davidkpiano deleted the feature/fix-state-meta branch November 10, 2026 16:24

This branch was successfully deployed

1 active deployment
Preview — 8de9b1b2 Deployed Nov 10, 2026 by vercel[bot]
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.

1 participant