Indicate Outdated SDK Version after App Name

Summary:
Per title

Earlier SDK version and this version (3) of Flipper determine a device for an app differently, so there is a case that both versions of the same app can refer to the same device which uses mutual name.

To resolve this problem, we change the name of previous SDK version of an app, so that
1) Both versions will be shown on the sidebar
2) Users know and hopefully update their apps to resolve the connection issue

Reviewed By: jknoxville

Differential Revision: D17376199

fbshipit-source-id: 3dc7c9b0bf99ff06c11c83eff0c72b6ce12f1a5a
This commit is contained in:
Chaiwat Ekkaewnumchai
2019-09-16 05:31:10 -07:00
committed by Facebook Github Bot
parent 2239ca65a5
commit d297b7bae2

View File

@@ -314,6 +314,14 @@ class Server extends EventEmitter {
: Promise.resolve(query.device_id)
).then(csrId => {
query.device_id = csrId;
// in previous version (before 3), app may not appear in correct device
// section because it refers to the name given by client which is not fixed
// for android emulators, so it is indicated as outdated so that developers
// might want to update SDK to get rid of this connection swap problem
if (query.sdk_version && query.sdk_version < 3) {
query.app += ' (Outdated SDK)';
}
const id = `${query.app}#${query.os}#${query.device}#${csrId}`;
console.debug(`Device connected: ${id}`, 'server');