Skip to content

Commit

Permalink
Update LogBoxData.js
Browse files Browse the repository at this point in the history
Symbolication stack fix facebook#41377
  • Loading branch information
joe-sam committed Jan 7, 2024
1 parent 028e2f0 commit 2fae1b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Libraries/LogBox/Data/LogBoxData.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type LogData = $ReadOnly<{|
message: Message,
category: Category,
componentStack: ComponentStack,
stack?: string,
|}>;

export type Observer = (
Expand Down Expand Up @@ -154,7 +155,7 @@ function appendNewLog(newLog: LogBoxLog) {
if (newLog.level === 'fatal') {
// If possible, to avoid jank, we don't want to open the error before
// it's symbolicated. To do that, we optimistically wait for
// sybolication for up to a second before adding the log.
// symbolication for up to a second before adding the log.
const OPTIMISTIC_WAIT_TIME = 1000;

let addPendingLog: ?() => void = () => {
Expand Down Expand Up @@ -198,7 +199,7 @@ export function addLog(log: LogData): void {
// otherwise spammy logs would pause rendering.
setImmediate(() => {
try {
const stack = parseErrorStack(errorForStackTrace?.stack);
const stack = parseErrorStack(log.stack ?? errorForStackTrace?.stack);

appendNewLog(
new LogBoxLog({
Expand Down

0 comments on commit 2fae1b6

Please sign in to comment.