-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent LogBox from crashing on long messages (#38005)
Summary: Pull Request resolved: #38005 Fixes #32093 by guarding the expensive `BABEL_CODE_FRAME_ERROR_FORMAT` regex with a cheaper initial scan. (Longer term, we should reduce our reliance on string parsing and propagate more structured errors.) Changelog: [General][Fixed] Prevent LogBox from crashing on very long messages Reviewed By: GijsWeterings Differential Revision: D46892454 fbshipit-source-id: 3afadcdd75969c2589bbb06f47d1c4c1c2690abd # Conflicts: # Libraries/LogBox/Data/parseLogBoxLog.js # packages/react-native/package.json
- Loading branch information
Showing
3 changed files
with
65 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @flow strict | ||
* @format | ||
*/ | ||
|
||
declare module 'ansi-regex' { | ||
declare export type Options = { | ||
/** | ||
* Match only the first ANSI escape. | ||
*/ | ||
+onlyFirst?: boolean, | ||
}; | ||
declare export default function ansiRegex(options?: Options): RegExp; | ||
} |
This file contains 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
f59db07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this in 0.72.4? If so the fix unfortunately doesn't work, exactly the same behavior as before. It makes Android dev unusable as it locks up the app for over a minute before failing.