From ee23119f2489e94b51b1e4e74d2de36c04afc669 Mon Sep 17 00:00:00 2001 From: John Knox Date: Thu, 6 Dec 2018 05:35:23 -0800 Subject: [PATCH] Throw error if more than one device has same csr in container Summary: Getting more visibility on this. We're seeing cases where the wrong deviceId is getting stored in the device connection_config.json. This comes from flipper desktop in the response of 'signCertificate', and is figured out using getTargetDeviceId. If we ever see these logs then something is wrong, and seeing the csr should help. Reviewed By: passy Differential Revision: D13357882 fbshipit-source-id: eb6befe07e7f9e7606e8940a1fed619351946d37 --- src/utils/CertificateProvider.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/CertificateProvider.js b/src/utils/CertificateProvider.js index ce2e93532..ec6ef3555 100644 --- a/src/utils/CertificateProvider.js +++ b/src/utils/CertificateProvider.js @@ -281,6 +281,12 @@ export default class CertificateProvider { `No matching device found for app: ${appName}`, ); } + if (matchingIds.length > 1) { + console.error( + new RecurringError('More than one matching device found for CSR'), + csr, + ); + } return matchingIds[0]; }); });