Summary:
Plumbs through an optional name for FollyScopedThreadScheduler.
This allows the threads to be named in XCode/lldb.
Differential Revision: D38582449
fbshipit-source-id: 1de50d25c0f91e7003cf81cb22faf4b10a8e23a8
Summary:
This change isolates the usage of folly async from Flipper. Is now self-contained in Flipper Folly schedulers.
Users of Flipper can decide not to use the types defined in that header and implement their own.
NOTE: changes are minimal, we are just replacing direct calls to folly event base with a scheduler which simply relays this on to folly.
Reviewed By: fabiomassimo
Differential Revision: D36626483
fbshipit-source-id: add0241caf4af0aa5c3b5c2e7efc2e725f5400ab
Summary:
This change isolates the usage of folly async from Flipper. Is now self-contained in Flipper Folly schedulers.
Users of Flipper can decide not to use the types defined in that header and implement their own.
NOTE: changes are minimal, we are just replacing direct calls to folly event base with a scheduler which simply relays this on to folly.
Reviewed By: fabiomassimo
Differential Revision: D36052198
fbshipit-source-id: 170d64a324a1f1f100224e2622a59cbac3c8b642
Summary: When building for Mac Catalyst, it mostly appears as if it's targeting iOS (`TARGET_OS_OSX` is `0`) and the behavior should be aligned with iOS Simulator builds.
Reviewed By: lblasa
Differential Revision: D34413681
fbshipit-source-id: 1e56bbb3f16f8cd78e77771ff641c5cfcbc49955
Summary:
^
Note: this is already a working case. The difference is that if we are unable to establish a socket connection, we will not attempt to create one using rsocket.
Changelog: Removes rsocket-fallback for mobile clients
Reviewed By: nikoant
Differential Revision: D33655430
fbshipit-source-id: cb6f752f2d1354ab46d011b1f19c89520e1e7dd3
Summary:
This change makes WebSockets the default for Flipper on iOS.
Having said that, we are introducing some logic to deal with clients connecting to older Flipper Desktop versions.
The mobile client will first attempt to connect via WebSocket with the Desktop. This connection can either be secure or insecure. If that fails, it will attempt to connect via RSocket.
Connection failure logic:
The mobile client will attempt to connect up-to 3 times via a WebSocket. If it fails to connect, then the socket provider is switched to RSocket.
As before, the mobile client will attempt to connect up-to 3 times via a RSocket. If it fails to connect, then the socket provider is switched back to WebSocket.
Process repeats until a successful connection is established.
Some logs that can be seen from iOS:
2021-09-15 14:31:51.193503+0100 Sample[92026:92107440] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
2021-09-15 14:31:51.878257+0100 Sample[92026:92107440] [connection] nw_socket_handle_socket_event [C1.1:1] Socket SO_ERROR [61: Connection refused]
2021-09-15 14:31:52.553729+0100 Sample[92026:92107440] [connection] nw_socket_handle_socket_event [C1.2:1] Socket SO_ERROR [61: Connection refused]
2021-09-15 14:31:52.899511+0100 Sample[92026:92107442] [connection] nw_connection_get_connected_socket [C1] Client called nw_connection_get_connected_socket on unconnected nw_connection
2021-09-15 14:31:52.899664+0100 Sample[92026:92107442] TCP Conn 0x600001d384d0 Failed : error 0:61 [61]
2021-09-15 14:31:57.120120+0100 Sample[92026:92107439] [connection] nw_socket_handle_socket_event [C2.1:1] Socket SO_ERROR [61: Connection refused]
2021-09-15 14:31:57.141785+0100 Sample[92026:92107439] [connection] nw_socket_handle_socket_event [C2.2:1] Socket SO_ERROR [61: Connection refused]
2021-09-15 14:31:57.151604+0100 Sample[92026:92107483] [connection] nw_connection_get_connected_socket [C2] Client called nw_connection_get_connected_socket on unconnected nw_connection
2021-09-15 14:31:57.154312+0100 Sample[92026:92107483] TCP Conn 0x600001d7c0b0 Failed : error 0:61 [61]
2021-09-15 14:31:59.206079+0100 Sample[92026:92107483] [connection] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused]
2021-09-15 14:31:59.236824+0100 Sample[92026:92107483] [connection] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused]
2021-09-15 14:31:59.251927+0100 Sample[92026:92107439] [connection] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection
2021-09-15 14:31:59.255963+0100 Sample[92026:92107439] TCP Conn 0x600001d1c210 Failed : error 0:61 [61]
2021-09-15 14:32:01.291303+0100 Sample[92026:92107439] [connection] nw_socket_handle_socket_event [C4.1:1] Socket SO_ERROR [61: Connection refused]
2021-09-15 14:32:01.312406+0100 Sample[92026:92107439] [connection] nw_socket_handle_socket_event [C4.2:1] Socket SO_ERROR [61: Connection refused]
2021-09-15 14:32:01.323099+0100 Sample[92026:92107483] [connection] nw_connection_get_connected_socket [C4] Client called nw_connection_get_connected_socket on unconnected nw_connection
2021-09-15 14:32:01.326028+0100 Sample[92026:92107483] TCP Conn 0x600001d7c0b0 Failed : error 0:61 [61]
flipper: Failed to connect with the current socket provider
flipper: Use legacy socket provider
flipper: FlipperClient::onConnected
Reviewed By: passy
Differential Revision: D30900471
fbshipit-source-id: 7c242ad71306803b050d0174fc22696bb74fdba5
Summary:
The changes below add the notion of alternative ports to Flipper.
These alternative ports are meant to and will be used to connect via WebSocket instead of RSocket. The name does not suggest that as to make as generic as possible so that they can be reused for different purposes in the future.
Reviewed By: passy
Differential Revision: D30898874
fbshipit-source-id: 5eed8c61b41b502c859192aaac59c284b7b36228
Summary: This change reverts a revert. The change was reverted for 'unrelated' issues addressed on this diff dependencies.
Reviewed By: passy
Differential Revision: D30696113
fbshipit-source-id: 8591d6ea79999597024c316e9927a346979e5219
Summary: Revert D30371791 (cac09d14aa) to address undefined symbols for a few sandcastle jobs
Reviewed By: fabiomassimo
Differential Revision: D30606610
fbshipit-source-id: 24a5c08bcf5456a96469650a4207b05970399181
Summary:
Contains the implementation of FlipperWebSocket with any necessary changes to use it but without switching it on.
About SocketRocket and Cocoapods
A decision had to be made about whether to define different sub-specs, one for RSocket and another for SocketRocket.
I've opted to keep the podspec as is because:
- Keeps pod consumption as is.
- Makes easier to switch implementations using GK.
- There's no intention to keep RSocket going into the future. So, there's no point in creating a sub-spec only to remove it in the future.
- SocketRocket is a relatively small library so is not contributing to a significant increase in binary size.
If, as reviewer, you consider a subspec makes more sense, then feel free to reach out to discuss.
Reviewed By: fabiomassimo
Differential Revision: D30371791
fbshipit-source-id: 225c5b1de76aff1a6e36640a41765b963aaa2796
Summary: This adds macOS compatibility to Flipper client along with some of the standard plugins.
Reviewed By: jknoxville
Differential Revision: D24644439
fbshipit-source-id: dc15636a6ac1bf684fa1c89735f51f0e97667b62
Summary:
This diff adds a toggle setting in wilde which will enable certificate exchange through www.
Right now it just sends the information about which medium to be used for cert exchange to Flipper JS and its client side. But its implementation is not done yet.
### Flow for Wilde
Whenever user changes the setting(or when user logs out) we set the state of exchange medium and accordingly set/reset authtoken. Note at no given point we remove already existing certificates.
### Context for OSS
With this diff we introduce another way to do certificate exchange. Before this diff, we did certificate exchange by accessing the file system of app. But it turns out it's not possible to do that in applications signed by enterprise certs. Thus with this diff one can write their FlipperKitCertificateProvider and fetch the certificate from WWW.
Reviewed By: jknoxville
Differential Revision: D22896320
fbshipit-source-id: 55aef7028a62e71ba9c02f9f79acaab41d09c0c6
Summary:
This diff runs CLANGFORMAT lint on FlipperKit. I have added CLANGFORMAT as the lint engined for objc files in xplat/sonar. Right now the iOS folder is not formatted according to CLANGFORMAT.
Ran `arc lint -a --paths-cmd "find ./iOS/FlipperKit -type f" --verbose`
Reviewed By: passy
Differential Revision: D19942170
fbshipit-source-id: af677323af4edb761f61f8f7e289cab743aa31f2
Summary: Add the affiliates bit that the linter is checking for.
Reviewed By: jknoxville
Differential Revision: D15164826
fbshipit-source-id: 500ffe89ec0c2fd3acfbc374408d16a337cecfa4
Summary: Only usable with a desktop app that supports physical iOS devices, which isn't released yet.
Reviewed By: passy
Differential Revision: D14132413
fbshipit-source-id: 376d1db06e46ae06346974f2acc95c3d2ff6825d
Summary:
Part 2 of changing flipper to use customizable ports: iOS SDK.
Still to go: JS app.
env var should be of the format:
`FLIPPER_PORTS=1111,2222` for insecure port: 1111 and secure port: 2222.
Reviewed By: danielbuechele
Differential Revision: D13800988
fbshipit-source-id: 3560ba850389964f4b784551b803c45c6524e6f0
Summary:
Disabling the port fordwarder.
On physical devices, when flipper isn't running and they don't have any certificates, they attempt to connect to the desktop.
They always connect to the portforwarder, even though it doesn't connect to flipper desktop.
After connecting to the portforwarder, they then try to generate the SSL certs. This is a CPU intensive operation and happens repeatedly in this condition when it really shouldn't be, causing high cpu usage.
Disabling for now. The fix will be to make sure that they only do that generation when they are fully connected.
Reviewed By: priteshrnandgaonkar
Differential Revision: D13507353
fbshipit-source-id: a858a5da7352228b063150334ea443130763d888
Summary: Adds support for physical iOS devices, when the necessary dependencies are present. Unfortunately these aren't open sourced yet so the open source build won't get this feature yet.
Reviewed By: priteshrnandgaonkar
Differential Revision: D13001473
fbshipit-source-id: d8c2bcd53b7972bec676717c8af0112800b918d0
Summary:
See FBPortForwarding/README.md for an explanation of what this is.
It's required for the upcoming support for physical iOS devices.
To simplify development of the JS app, We're going to bundle the pre-built PortForwardingMacApp
inside the repo, and inside the electron app (static/PortForwardingMacApp.app).
Adding this source so users can build it from source if they choose to.
Reviewed By: danielbuechele
Differential Revision: D13276022
fbshipit-source-id: 99b18e0412cf443bb4a67eb4846cc780e0014de1
Summary:
This diff adds few tests for flipper client on iOS side. This tests are similar to the ones which exists in xplat but this tests the iOS side of flipper client.
Following tests are added
- connect , disconnect block called on plugin
- background plugin activated before init method
- crash getting suppressed
Reviewed By: jknoxville
Differential Revision: D13167637
fbshipit-source-id: 6c21d5cf2f08e7e3c17ecacbf3badfbde80fb5d1
Summary:
The appId field gets embedded into the certificate request, so flipper knows which app to provide the cert to.
In iOS this field is never used, so far, because the destination path uniquely identifies the app so this is redundant.
For physical iPhones however, knowing the bundle id lets you deploy files into the container, so we can use this value.
Reviewed By: passy
Differential Revision: D13000296
fbshipit-source-id: 9f21850b908a03f1be87dc204e59d616150cc7ec
Summary:
This diff sets up flipper for running plugins in background. This diff does the following
- Adds a function named `runInBackground` to the interface `FlipperPlugin` to make the plugins opt in to be run in background, default is false
- Changes the javascript side of the flipper to store the messages received by the plugins in background
- Process the stored messages when the plugin in background becomes active
- Currently I have just turned on network plugin to be in background mode.
- Remove the buffering from the network plugin, as it will run in background
- Write a batching layer to batch the messages and send to flipper.
Note: I haven't tested the wilde app yet, but the sample app works. I will remove the "[WIP]" from the title once I have tested it in wilde
Reviewed By: danielbuechele
Differential Revision: D10301403
fbshipit-source-id: 034eebf659a545d6b480a4ac1b73b0aa4b2f9797
Summary: This should not affect prod as flipper (also called sonar) should only be an internal debug product but i needed to fix it to start the app.
Reviewed By: jknoxville
Differential Revision: D10156590
fbshipit-source-id: 84a76e5cbe2f4bbe89627895efcfb7e6cdadae13
Summary: Check that it never hangs or crashes during startup
Reviewed By: priteshrnandgaonkar
Differential Revision: D10034630
fbshipit-source-id: b69ce9e6f91a5499a084c4d7328e6934ec92ece4
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