From d9c8b5dd640e36413bcb5189d12a724a50228c62 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Wed, 5 Feb 2020 04:23:09 -0800 Subject: [PATCH] Do not fail if there are entries in errorArray from exportStore Summary: Currently `exportStore` function returns the serialized string along with errorArray. errorArray contains an error when there is some issue with fetching metadata. Essentially, it keeps the error in the errorArray and continues with fetching the data for the next plugin. Previously we used to exit our submit form execution when the errorArray had any value. So this diff removes that check and instead logs it on the console and in our logging system. It will handle the case mentioned [here](https://fb.workplace.com/groups/1430200360634661/permalink/2566831316971554/) This diff also adds a log when there is failure to upload flipper data. Reviewed By: mweststrate Differential Revision: D19723674 fbshipit-source-id: 18bf90461156f67ecc2b4ce4b1eac4aa3485188d --- src/utils/exportData.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils/exportData.tsx b/src/utils/exportData.tsx index 64970decd..c76e49d88 100644 --- a/src/utils/exportData.tsx +++ b/src/utils/exportData.tsx @@ -43,6 +43,7 @@ import {deconstructClientId, deconstructPluginKey} from '../utils/clientUtils'; import {performance} from 'perf_hooks'; import {processMessageQueue} from './messageQueue'; import {getPluginTitle} from './pluginUtils'; +import {logPlatformSuccessRate} from './metrics'; export const IMPORT_FLIPPER_TRACE_EVENT = 'import-flipper-trace'; export const EXPORT_FLIPPER_TRACE_EVENT = 'export-flipper-trace'; @@ -616,6 +617,15 @@ export async function exportStore( plugins: state.plugins.selectedPlugins, }, ); + if (errorArray.length > 0) { + const errorStr = errorArray.join(', '); + logPlatformSuccessRate('export-store-task', { + kind: 'failure', + supportedOperation: true, + error: errorStr, + }); + console.error('Export Store Task Failures: ', errorStr); + } return {serializedString, errorArray}; } else { return {serializedString: '{}', errorArray: []};