From 47d3dd64137ee6498596ca4b4a2528857a0f6e2e Mon Sep 17 00:00:00 2001 From: James Harmon Date: Mon, 24 Aug 2020 14:54:41 -0700 Subject: [PATCH] Load routes to device during init (#1491) Summary: This is a replacement for PR https://github.com/facebook/flipper/pull/1486 which had the wrong username When the network plugin is loaded, the route table in the device is empty. It needs to be populated with whatever routes have already been created and saved in local storage. Otherwise, the user would need to modify the routes to force an update. Issue is described here - https://github.com/facebook/flipper/issues/1476 ## Changelog Routes updated in device when plugin is initialized Pull Request resolved: https://github.com/facebook/flipper/pull/1491 Test Plan: 1. Create a mock for the get request in the sample Android app 2. Kill the app 3. Start the app 4. Issue the get request in the app 5. Verify that the request is mocked in the Network plugin ![image](https://user-images.githubusercontent.com/69264583/90853263-37648200-e33f-11ea-8ab1-afc09395e62e.png) Reviewed By: passy Differential Revision: D23292355 Pulled By: mweststrate fbshipit-source-id: 2fe16e9067a627cae02a4b1db422952d364fd036 --- desktop/plugins/network/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop/plugins/network/index.tsx b/desktop/plugins/network/index.tsx index e53ddbd3c..c2a382317 100644 --- a/desktop/plugins/network/index.tsx +++ b/desktop/plugins/network/index.tsx @@ -342,6 +342,7 @@ export default class extends FlipperPlugin { showMockResponseDialog: false, nextRouteId: Object.keys(routes).length, }); + informClientMockChange(routes); }); this.setState(this.parseDeepLinkPayload(this.props.deepLinkPayload));