From 223f4ac2c50d0a4c4d911d1b0295f10a8dc19cf8 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Fri, 21 Aug 2020 10:05:19 -0700 Subject: [PATCH] Remove startup errors (#1484) Summary: This diff removes some irrelevant error messages that are always logged in the OSS build, and got even reported a few times. The yarn lock file somehow got in a state where emotion/core was included twice (probably due to having a really old yarn version here), causing the logs view to crash. So fixed that manually. P.S. the fact that the warning in the screenshot does not take the full width is an issue in console-feed component itself, I opened https://github.com/samdenty/console-feed/pull/50 for that ## Changelog changelog: Removed some irrelevant errors from startup flow Pull Request resolved: https://github.com/facebook/flipper/pull/1484 Test Plan: Before ![Screenshot from 2020-08-19 14-18-51](https://user-images.githubusercontent.com/1820292/90639856-33454100-e227-11ea-8d34-94ec4e7ea61d.png) After ![Screenshot from 2020-08-19 14-11-52](https://user-images.githubusercontent.com/1820292/90639881-3b9d7c00-e227-11ea-9cef-e3a96a89ba9d.png) Reviewed By: jknoxville Differential Revision: D23220937 Pulled By: mweststrate fbshipit-source-id: 5f7b28adfbf99c938ad3abba75f26c6917463510 --- desktop/app/src/dispatcher/metroDevice.tsx | 6 ++++-- desktop/app/src/dispatcher/user.tsx | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/desktop/app/src/dispatcher/metroDevice.tsx b/desktop/app/src/dispatcher/metroDevice.tsx index dafd3dfae..3a625609f 100644 --- a/desktop/app/src/dispatcher/metroDevice.tsx +++ b/desktop/app/src/dispatcher/metroDevice.tsx @@ -38,8 +38,10 @@ async function isMetroRunning(): Promise { resolve(isMetro); }); }) - .on('error', (err) => { - console.debug('Could not connect to METRO ' + err); + .on('error', (err: any) => { + if (err.code !== 'ECONNREFUSED') { + console.error('Could not connect to METRO ' + err); + } resolve(false); }); }); diff --git a/desktop/app/src/dispatcher/user.tsx b/desktop/app/src/dispatcher/user.tsx index 34a79ab13..affa9c7df 100644 --- a/desktop/app/src/dispatcher/user.tsx +++ b/desktop/app/src/dispatcher/user.tsx @@ -12,8 +12,13 @@ import {Logger} from '../fb-interfaces/Logger'; import {login, logout} from '../reducers/user'; import {getUser, logoutUser} from '../fb-stubs/user'; import {sideEffect} from '../utils/sideEffect'; +import config from '../fb-stubs/config'; export default (store: Store, _logger: Logger) => { + if (!config.isFBBuild) { + return; + } + getUser() .then((user) => { store.dispatch(login(user));