core
core copied to clipboard
[base-controller] Require metadata for optional state properties
The StateMetadata type in BaseControllerV2 was intended to require each state property to have associated metadata. However, currently it doesn't require metadata for optional fields. This is problematic because all top-level state properties are expected to have metadata, and will throw an error at runtime if it's missing.
We should update the StateMetadata type to require metadata for all properties, including optional properties.