Skip to content

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Sep 12, 2025

Explanation

Make the planned breaking changes to controller metadata. This includes renaming anonymous to includeInDebugSnapshot, and it includes making the two new metadata properties required.

References

Relates to #6443

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Make the planned breaking changes to controller metadata. This includes
renaming `anonymous` to `includeInDebugSnapshot`, and it includes
making the two new metadata properties required.

Relates to #6443
@Gudahtt Gudahtt marked this pull request as ready for review September 12, 2025 20:36
@Gudahtt Gudahtt requested a review from a team as a code owner September 12, 2025 20:36
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Metadata Constraint Mismatch

The StatePropertyMetadataConstraint type is out of sync with StatePropertyMetadata. It still uses the anonymous property instead of includeInDebugSnapshot, and includeInStateLogs and usedInUi are optional instead of required. This breaks its intended supertype relationship, causing type incompatibility.

packages/base-controller/src/next/BaseController.ts#L109-L120

/**
* A universal supertype of `StatePropertyMetadata` types.
* This type can be assigned to any `StatePropertyMetadata` type.
*/
export type StatePropertyMetadataConstraint = {
anonymous: boolean | StateDeriverConstraint;
includeInStateLogs?: boolean | StateDeriverConstraint;
persist: boolean | StateDeriverConstraint;
usedInUi?: boolean;
};

Fix in Cursor Fix in Web


Copy link
Contributor

@cryptodev-2s cryptodev-2s left a comment

Choose a reason for hiding this comment

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

LGTM!

@Gudahtt Gudahtt merged commit dac2789 into main Sep 12, 2025
240 checks passed
@Gudahtt Gudahtt deleted the require-new-metadata-in-next-base-controller branch September 12, 2025 20:45
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