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:
This change addresses a warning and provides a safer way of resolving the connection promise.
Also, fixes an issue whereas the websocket connection was not being reestablished as the listener is not notified when we manually disconnect.
Reviewed By: passy
Differential Revision: D32591859
fbshipit-source-id: 78ce4eac5414a924217867f2f47b04829da3b705
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:
The crash logged from `ErrorReporterRunnable` wasn't detailed. For example look at the following video.
Also for some reason the `FlipperConnection` interface doesn't have an argument for crash name. Thus I changed the js side of the plugin to accept `crash.name` to be undefined.
{F155526537}
Reviewed By: passy
Differential Revision: D14852561
fbshipit-source-id: 6daf9847535b4508fa312b4f940b014911aae2e5
Summary: If a plugin thows an exception pointer instead of by value, we should capture it and stop the app from crashing.
Reviewed By: passy
Differential Revision: D14243644
fbshipit-source-id: a2e5dde2b36c430355552e3305634baa5913b703
Summary:
Flipper exposes a call() api to plugins which lets them call their sdk component, and it returns a promise with the response.
Currently this is done by sending a fireAndForget request, noting the id of the request, and then receiving fireAndForget requests and matching up the ids to give the result back to the right plugin promise.
Instead, it will be simpler to use rsocket requestResponse, instead of fireAndForget, which is for this exact use case. This diff adds a requestResponse handler to the SDK, so that it can deal with such requests and respond accordingly, while preserving the current functionality if it receives a fireAndForget.
So this part is backwards compatible and should be safe to land in isolation.
A later diff will change the desktop app to use requestResponse, which may not be backwards compatible, so that will have to be deployed more carefully.
Reviewed By: passy
Differential Revision: D13974049
fbshipit-source-id: b371d94a86b1f186375161ed8f2242a462ce418f
Summary:
Part 1 of enabling flipper to run on custom ports: android SDK.
Still to go: iOS SDK and desktop
This should allow you to run mobile apps that use flipper on different ports than the default (8089,8088).
`adb shell`
`su`
`setprop flipper.ports 1111,2222`
From what I can tell, this only works on rooted devices.
Reviewed By: passy
Differential Revision: D13753238
fbshipit-source-id: c5f370c9d8c7382e8c17fb81d4010c642ef7c114
Summary:
This deprecates the `getPlugin(String)` method and introduces
a `getPluginByClass(Class<T>)` instead which avoids having
to `instanceof`-check and then cast the result, which provides
a nicer experience for Java users.
Reviewed By: jknoxville
Differential Revision: D13277568
fbshipit-source-id: fb7b5b8c0180470ef0ad322559b5b7424520848b
Summary: This diff wraps all the important places where the java code is called in a try-catch block in order to avoid flipper bringing down an app.
Reviewed By: jknoxville
Differential Revision: D12839504
fbshipit-source-id: 4711bccbe6d50094d76ed7ecd1eb652cefc2a090
Summary:
Add support for plugins to opt in to background for android.
This diff does the following
- Adds a method `runInBackground` in java interface of `FlipperPlugin`
- Make the network plugin opt in to run in background
Reviewed By: danielbuechele
Differential Revision: D10360033
fbshipit-source-id: b31c7550d00b760b7033c150232e3925b6272d24
Summary: Part of sonar to flipper rename
Reviewed By: passy
Differential Revision: D9920332
fbshipit-source-id: 99b5cf33c07ca5d9cd59af21490fea18272e67d9
Summary: Part of sonar to flipper rename
Reviewed By: passy
Differential Revision: D9919821
fbshipit-source-id: a44a2a04d5463750f884f8bf1328e02d56593e82
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
Summary:
Rename everything `Sonar*.java` in `core/`.
Biggest chunk of the rename happened with
```fish
for name in (cat names.txt)
ambr --no-interactive --regex '\b'"$name"'\b' (echo $name | sed 's/Sonar/Flipper/') fbandroid/java/com/facebook
end
```
names.txt:
```
SonarArray
SonarClient
SonarConnection
SonarDynamic
SonarObject
SonarPlugin
SonarReceiver
SonarResponder
SonarStateUpdateListener
SonarValue
```
The controller you requested could not be found.
Reviewed By: priteshrnandgaonkar
Differential Revision: D9940900
fbshipit-source-id: 4a1342fac02513025d80dcb0af62c26ea38b5086
Summary:
This soft-breaks Android Studio support because folder names no longer map to package names, but this will be mitigated by future diffs.
Steps taken for rename:
```
cd xplat/sonar/android/;
ambr 'com.facebook.sonar' 'com.facebook.flipper'
```
Reviewed By: danielbuechele
Differential Revision: D9850009
fbshipit-source-id: d26d8ab783e7050e4e2fbdd0c35eae3f97879464
Summary:
Adds a more structured representation of state updates than a multiline string.
Also changes the string form to omit [started] records.
Reviewed By: danielbuechele
Differential Revision: D9315503
fbshipit-source-id: 55b8f9572091fd42fe852c8d26a8f2a53f76c82a
Summary:
The plan is to get SonarState to take update events and aggregate them into an object, that can be displayed in the UI so you can see what sonar is currently trying to do, and what if anything is failing.
This is pretty rubbish right now, as it just uses a single string to represent state, this is just the initial version I'll iterate on.
I also need to pass the SonarState into the SonarWebSocketImpl, since that's where a lot of the heavy lifting is done, but as long as something is logging state updates here, it proves the concept.
SonarStateUpdateListener is the interface that will be implemented by android and iOS implementations. These implementations will notify an activity or screen that the state has changed and they should reflect that.
Reviewed By: danielbuechele
Differential Revision: D9150551
fbshipit-source-id: 8dd585ca503d32e684ff843d66a59a50a420b4c0
Summary:
The plan is to get SonarState to take update events and aggregate them into an object, that can be displayed in the UI so you can see what sonar is currently trying to do, and what if anything is failing.
This is pretty rubbish right now, as it just uses a single string to represent state, this is just the initial version I'll iterate on.
I also need to pass the SonarState into the SonarWebSocketImpl, since that's where a lot of the heavy lifting is done, but as long as something is logging state updates here, it proves the concept.
SonarStateUpdateListener is the interface that will be implemented by android and iOS implementations. These implementations will notify an activity or screen that the state has changed and they should reflect that.
Reviewed By: passy
Differential Revision: D8932114
fbshipit-source-id: fb03babfe92be53771eb4d8f10de7ecdc7f1a6d8
Summary:
Those hadn't been updated as part of the move and cause runtime
failures.
Reviewed By: priteshrnandgaonkar
Differential Revision: D8931211
fbshipit-source-id: bc874eeea39134d6da9e16f6771bf0d3d3c02473