From 09107460a385e70a4fbf08445f1f004210e95746 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 16 Aug 2021 05:31:37 -0700 Subject: [PATCH] Filter duplicate requests Summary: Right now this is throwing an error, we instead gracefully handle this. I'm not quite sure where this is coming from but as we're not really doing anything with the requests before they're added here, it must be coming from the network stack. We can't really build another stable key on the client side because we also need to match it up with the response. Open for ideas! Changelog: Network requests with duplicate IDs are filtered out Reviewed By: mweststrate Differential Revision: D30337820 fbshipit-source-id: d312833727b383fa5f4d18a506ab581cd2151d13 --- desktop/plugins/public/network/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop/plugins/public/network/index.tsx b/desktop/plugins/public/network/index.tsx index 8deb31c37..7c579208c 100644 --- a/desktop/plugins/public/network/index.tsx +++ b/desktop/plugins/public/network/index.tsx @@ -154,7 +154,12 @@ export function plugin(client: PluginClient) { }); client.onMessage('newRequest', (data) => { - requests.append(createRequestFromRequestInfo(data, customColumns.get())); + // Some network stacks may send duplicate data, so we filter them out. + if (requests.has(data.id)) { + console.warn(`Ignoring duplicate request with id ${data.id}:`, data); + } else { + requests.append(createRequestFromRequestInfo(data, customColumns.get())); + } }); function storeResponse(response: ResponseInfo) {