Summary:
[Step 2 of a protocol change between desktop app and agent]
The flipper agent periodically tries to connect.
When it doesn't have the required certs, instead of trying to connect, it requests them from the desktop.
After requesting, it just continues the loop, trying to request.
The problem with that is
a) the desktop can take longer than one cycle to generate and provide the certs, meaning the agent will make overlapping requests, causing confusion and it to take longer than necessary.
b) the desktop can take less time than a retry cycle, but the agent will still wait before trying to connect.
Fixing a) by making the agent wait for a response from the desktop before continuing attempting to reconnect.
This means on the next connection attempt, it's guaranteed that the desktop is finished processing the CSR.
b) remains unfixed for now, but can be dealt with separately.
This changes the agent to use requestResponse, instead of fireAndForget and wait for a response from Flipper before continuing.
Also added a fallback to detect old versions of Flipper/Sonar and use the oldFireAndForget method in those cases.
Reviewed By: passy
Differential Revision: D9179393
fbshipit-source-id: e782b303b5e441f7d6c7faa3e5acdcbfb51e5e9c