Summary: in FlipperRSocketResponder::handleFireAndForget, a responder object was being conditionally (for requests with an "id" field) created, resulting in a null pointer passed into FlipperClient::onMessageReceived when no id was present. FlipperClient::onMessage received, in the meantime, unconditionally dereferences that pointer, resulting in a segmentation fault. This change creates the responder object regardless of whether or not the "id" key is present in the request object, thus avoiding passing a null pointer into FlipperClient::onMessageReceived.
Reviewed By: jknoxville
Differential Revision: D18583898
fbshipit-source-id: 2112c45bc0cd639cec908d0039d6bdaed2f61491
Summary:
`/*` is the standard throughout open source code. For example, Firefox uses single /*: https://hg.mozilla.org/mozilla-central/file/21d22b2f541258d3d1cf96c7ba5ad73e96e616b5/gfx/ipc/CompositorWidgetVsyncObserver.cpp#l3
In addition, Rust considers `/**` to be a doc comment (similar to Javadoc) and having such a comment at the beginning of the file causes `rustc` to barf.
Note that some JavaScript tooling requires `/**`. This is OK since JavaScript files were not covered by the linter in the first place, but it would be good to have that tooling fixed too.
Reviewed By: zertosh
Differential Revision: D15640366
fbshipit-source-id: b4ed4599071516364d6109720750d6a43304c089
Summary: Its helpful to store all history of sent messages for testing purposes.
Reviewed By: jknoxville
Differential Revision: D14797191
fbshipit-source-id: 0e58166cb4ab79852165f2107b2f6bcd259f1096
Summary:
If an exception is thrown from the plugin, FlipperClient.cpp will catch it and respond with an error response.
If the object goes out of scope with no response being returned, then return a success response in the destructor.
Reviewed By: passy
Differential Revision: D14024259
fbshipit-source-id: 52e419dd23fc3882e8b92b593e8c1e1ea90e2b26
Summary:
Changing FlipperRSocketResponder to only use public parts of FlipperConnectionManagerImpl.
This means we can test it by injecting a FCM mock, and it can use its public interface.
Reviewed By: passy
Differential Revision: D14000078
fbshipit-source-id: c0431a888b0ca041807631c81b99fb8b947274d6
Summary: Added tests for flipper client which makes sure that didconnect is called in the case of background plugin. It also checks the case of a non background plugin.
Reviewed By: jknoxville
Differential Revision: D13152686
fbshipit-source-id: 7850f66a42d669243f656a1e1c26584869ee919f
Summary: Part of sonar to flipper rename
Reviewed By: priteshrnandgaonkar
Differential Revision: D9929102
fbshipit-source-id: 88cdbd33aa5c76e386449f54f4eb8c6435865ed1
Summary:
Part of Sonar -> Flipper rename.
It's about time this is renamed from *Websocket as well, since it doesn't use websockets anymore.
Reviewed By: passy
Differential Revision: D9919695
fbshipit-source-id: 78a63bfb7d5de19c093b7fb775d1426b4fc58f77
Summary:
Part of the Sonar -> Flipper rename
Intentionally left externally visible buck target as Sonar for now to minimize diff size.
Reviewed By: passy
Differential Revision: D9871684
fbshipit-source-id: 6926eb62c578a05cd895745c75ed7da3cfe965b5