Fixes an issue with client queries and rsocket
Summary: This is necessary as we map from the protocol medium to our internal medium representation. Reviewed By: mweststrate Differential Revision: D46557431 fbshipit-source-id: 617307cd860e1c7e230be2441c06417c44af580e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c347fae7c1
commit
bd809853e7
@@ -28,6 +28,7 @@ import {
|
|||||||
ClientQuery,
|
ClientQuery,
|
||||||
ClientResponseType,
|
ClientResponseType,
|
||||||
} from 'flipper-common';
|
} from 'flipper-common';
|
||||||
|
import {transformCertificateExchangeMediumToType} from './Utilities';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RSocket based server. RSocket uses its own protocol for communication between
|
* RSocket based server. RSocket uses its own protocol for communication between
|
||||||
@@ -104,9 +105,13 @@ class ServerRSocket extends ServerAdapter {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const clientQuery: SecureClientQuery = JSON.parse(payload.data);
|
const query = JSON.parse(payload.data);
|
||||||
clientQuery.rsocket = true;
|
const clientQuery: SecureClientQuery = {
|
||||||
// TODO: Add a migration guide
|
...query,
|
||||||
|
medium: transformCertificateExchangeMediumToType(query.medium),
|
||||||
|
rsocket: true,
|
||||||
|
};
|
||||||
|
|
||||||
this.listener.onDeprecationNotice(
|
this.listener.onDeprecationNotice(
|
||||||
`[conn] RSockets are being deprecated at Flipper. Please, use the latest Flipper client in your app to migrate to WebSockets. App: ${clientQuery.app}. Device: ${clientQuery.device}.`,
|
`[conn] RSockets are being deprecated at Flipper. Please, use the latest Flipper client in your app to migrate to WebSockets. App: ${clientQuery.app}. Device: ${clientQuery.device}.`,
|
||||||
);
|
);
|
||||||
@@ -214,7 +219,12 @@ class ServerRSocket extends ServerAdapter {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const clientQuery: ClientQuery = JSON.parse(payload.data);
|
const query = JSON.parse(payload.data);
|
||||||
|
const clientQuery: ClientQuery = {
|
||||||
|
...query,
|
||||||
|
medium: transformCertificateExchangeMediumToType(query.medium),
|
||||||
|
rsocket: true,
|
||||||
|
};
|
||||||
this.listener.onConnectionAttempt(clientQuery);
|
this.listener.onConnectionAttempt(clientQuery);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user