Fix hard errors in filter parsing#55675
Closed
NickGerleman wants to merge 2 commits intofacebook:mainfrom
Closed
Conversation
6ea3825 to
77e659e
Compare
77e659e to
fee66ce
Compare
|
@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
fee66ce to
aeba27c
Compare
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
aeba27c to
e4e1357
Compare
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
e4e1357 to
e7a4cb9
Compare
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
e7a4cb9 to
eefee33
Compare
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
eefee33 to
c5c536a
Compare
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
|
This pull request has been merged in 6c83352. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
filterTypeFromString()throwsstd::invalid_argumenton unknown filter names, which crashes inparseFilterRawValuewhere it's called without try/catch. Change the return type tostd::optional<FilterType>and returnstd::nulloptinstead of throwing. Update callers inFilterPropsConversions.hto check the optional and gracefully return empty results.Changelog: [Internal]
Differential Revision: D94052729