From e19d6a723e6f14e5e7ac85bb13c5c0ceb5a0a90f Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Thu, 4 Apr 2019 04:36:11 -0700 Subject: [PATCH] Fix open log bug Summary: For the native crash, the crash log is logged as seperate messages. So crash reporter plugin merges them together and fires one notification. The merrging logic is timer based, so if multiple crash log message is posted in 50ms, it will be combined in one notification. For the above case, the "Open in Logs" functionality was broken, as we used to compare the entire callstack in one entry rather than in the multiple rows. This diff fixes this issue. Bug: {F155167144} Reviewed By: jknoxville Differential Revision: D14748956 fbshipit-source-id: d24db6d47fa3cd633a9002ac77f37c267ca4924f --- src/plugins/logs/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/plugins/logs/index.js b/src/plugins/logs/index.js index cadd36c82..38a349782 100644 --- a/src/plugins/logs/index.js +++ b/src/plugins/logs/index.js @@ -423,6 +423,18 @@ export default class LogTable extends FlipperDevicePlugin< break; } } + if (highlightedRows.size <= 0) { + // Check if the individual lines in the deeplinkPayload is matched or not. + const arr = deepLinkPayload.split('\n'); + for (let msg of arr) { + for (let i = rows.length - 1; i >= 0; i--) { + if (rows[i].filterValue && rows[i].filterValue.includes(msg)) { + highlightedRows.add(rows[i].key); + break; + } + } + } + } return highlightedRows; };