Skip to content

Conversation

@asalsys
Copy link
Contributor

@asalsys asalsys commented Dec 16, 2025

Explanation

The localOverrides and rawRemoteFeatureFlags properties were recently added to RemoteFeatureFlagControllerState in PR #7271 as required properties. However, consumers with existing persisted state from before these properties were added will experience TypeScript errors when their state is loaded, since these properties won't exist in the persisted data but are marked as required.

This PR marks localOverrides and rawRemoteFeatureFlags as optional in the RemoteFeatureFlagControllerState type to ensure backwards compatibility with existing persisted state. The getDefaultRemoteFeatureFlagControllerState() function continues to initialize these properties with empty objects, so newly created state will still have them populated.

References

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@asalsys asalsys requested review from a team as code owners December 16, 2025 20:55
@asalsys asalsys self-assigned this Dec 16, 2025
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@asalsys asalsys added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main with commit b5e7e19 Dec 16, 2025
291 of 292 checks passed
@asalsys asalsys deleted the fix/make-new-remote-feature-flag-controller-variables-optional branch December 16, 2025 21:53
asalsys added a commit that referenced this pull request Dec 16, 2025
## Explanation

The `localOverrides` and `rawRemoteFeatureFlags` properties were
recently added to `RemoteFeatureFlagControllerState` in PR #7271 as
required properties. However, consumers with existing persisted state
from before these properties were added will experience TypeScript
errors when their state is loaded, since these properties won't exist in
the persisted data but are marked as required.

This PR marks `localOverrides` and `rawRemoteFeatureFlags` as optional
in the `RemoteFeatureFlagControllerState` type to ensure backwards
compatibility with existing persisted state. The
`getDefaultRemoteFeatureFlagControllerState()` function continues to
initialize these properties with empty objects, so newly created state
will still have them populated.

## References

- Related to #7271

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
@asalsys asalsys mentioned this pull request Dec 16, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants