Skip to content

Fix hard errors in filter parsing#55675

Closed
NickGerleman wants to merge 2 commits intofacebook:mainfrom
NickGerleman:export-D94052729
Closed

Fix hard errors in filter parsing#55675
NickGerleman wants to merge 2 commits intofacebook:mainfrom
NickGerleman:export-D94052729

Conversation

@NickGerleman
Copy link
Copy Markdown
Contributor

Summary:
filterTypeFromString() throws std::invalid_argument on unknown filter names, which crashes in parseFilterRawValue where it's called without try/catch. Change the return type to std::optional<FilterType> and return std::nullopt instead of throwing. Update callers in FilterPropsConversions.h to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 23, 2026
@NickGerleman NickGerleman force-pushed the export-D94052729 branch 2 times, most recently from 6ea3825 to 77e659e Compare February 23, 2026 10:52
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Feb 23, 2026

@NickGerleman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94052729.

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:
Pull Request resolved: facebook#55675

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Differential Revision: D94052729
facebook#55674)

Summary:

Centralize gated ViewConfig processor attributes into exported constants in `ReactNativeStyleAttributes.js`. This is a pure refactor — no new behavior. When `enableNativeCSSParsing()` is on, the JS processor is bypassed and the raw value is sent directly to native.

Exported attributes: `colorAttribute`, `filterAttribute`, `boxShadowAttribute`, `backgroundImageAttribute`, `backgroundSizeAttribute`, `backgroundPositionAttribute`, `backgroundRepeatAttribute`.

All ViewConfig files now import these constants instead of inlining `{process: require(...)}` or feature flag checks.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D94052734
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D94052729
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 24, 2026
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D94052729
@meta-codesync meta-codesync Bot closed this in 6c83352 Feb 24, 2026
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 24, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Feb 24, 2026

This pull request has been merged in 6c83352.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants