Summary: The active child was only being passed for the native scan full traversal, Now we have it for the partial traversal also
Reviewed By: lblasa
Differential Revision: D39466933
fbshipit-source-id: a0e281e4f9a21bf2edd12f18ecdb68a29ead3476
Summary: Added an initial litho Tree observer and descriptors, its quiet naive and will be improved in a future diff
Reviewed By: lblasa
Differential Revision: D39466931
fbshipit-source-id: 66a462882af2e585b9719ee2f61595449f99c5e5
Summary: While looking at the event stream it is useful to know which observer type fired it
Reviewed By: lblasa
Differential Revision: D39430756
fbshipit-source-id: bc52f085a5497692f8076b12a9c015cc33a19d1e
Summary:
There is a bug in the code to get fragments from the activity.
A boolean, result from the comparison, was added to the list instead of the actual fragments.
Reviewed By: LukeDefeo
Differential Revision: D39348019
fbshipit-source-id: 669f304055f15f59b40352d86f25d768d92df76e
Summary:
Now that we have the tree observer we can make descriptors completely about describing an object. To that end we have removed init method and made them all object to indicate to future readers their singleton nature.
onGetActive child was made open instead of abstract to avoid needed to override in all subclasses
Reviewed By: lblasa
Differential Revision: D39387935
fbshipit-source-id: 802b8afdd9aa639daecf10d774ca5b960ee48003
Summary:
Added concept of a tree observer which is responsible for listening to the changes for a portion of the UI tree. This structure nests so Tree observers can hold child tree observers which emit events on a different cadence. This structure should allow us to incorporate different UI frameworks down the road as well as native android views.
We push the tree updates from the tree observers onto a channel and setup a coroutine to consume this channel, serialize and send down the wire.
Reviewed By: lblasa
Differential Revision: D39276681
fbshipit-source-id: a4bc23b3578a8a10b57dd11fe88b273e1ce09ad8
Summary: A node can have an active child, if present we assume all others are inactive and we don't traverse them. This means the activities not on top and view pager views not active will not be scanned. Additionally on the desktop we are automatically collapsing these views. The net result is a lot less work done on the main thread
Reviewed By: lblasa
Differential Revision: D39310126
fbshipit-source-id: ebd0c69d46f2d42fe42e678c8327fcdc73d08385
Summary:
^
This was replaced by `ApplicationRef`
Reviewed By: antonk52
Differential Revision: D39313539
fbshipit-source-id: ad9b5c3ed963046ba0349fd5112bb9cb5de7640b
Summary: Added simple activity to test how flipper reacts to changes in native UI
Reviewed By: passy
Differential Revision: D38704012
fbshipit-source-id: 8a593577322922c6f6f0f96dd5cb0761c3035389
Summary: Added scheduler to scan the Native UI every 500 ms to test, Also added instrumentation in a separate event with the timings of each stage visualised in a Data table on desktop which can be accessed with ctrl+I. Currently this instrumentation event is sent every time but it could be a config option controlled from the desktop in the future
Reviewed By: lblasa
Differential Revision: D39205313
fbshipit-source-id: ca034171db6b062396b4ef28028aaa663c4d852a
Summary: Move from a nested structure to a flatten one for data exchange, this will allow us to only send sections of the UI in the future
Reviewed By: lblasa
Differential Revision: D38982138
fbshipit-source-id: d578a07a6d2d7e117fbd741bd6e33062223ce10d
Summary:
Introduced a JSON like tree structure for the sidebar insepector. Descriptors can provide their data as well as if its mutable or not.
Enum mapping was simplified
Reviewed By: lblasa
Differential Revision: D38947238
fbshipit-source-id: cd8a6a8a752c5f626582ab8ac5efae6e9ff6a2ad
Summary: Filpper is doing disk IO on UI thread which actually produce `DiskWriteViolation` (presumably when the directory is not there, it will write to create)
Differential Revision: D39196484
fbshipit-source-id: f6b15785ea6ecf3ea5b41211908c14eac3d1309e
Summary:
^
The last change removed the overload of `send` in favour of `sendRaw`
Reviewed By: LukeDefeo
Differential Revision: D38946386
fbshipit-source-id: c4491c4afe4d719602c99878dc7185d436179aef
Summary:
Add a simple scheduler which operates in the following way.
There are two type of tasks: main, background.
The main task will run on the main thread whilst the background task will run on a background thread.
The main task will be executing at a fixed internal whereas the background task will get queued on demand but can effectively consume what was produced by the main task at its own rate.
Reviewed By: LukeDefeo
Differential Revision: D38975283
fbshipit-source-id: 0633385d2938705a16f5fc75a28cad067e4a8e55
Summary: This adds a simple traversal to the UI. As it stands, it will most likely be updated in future iterations.
Reviewed By: LukeDefeo
Differential Revision: D38907292
fbshipit-source-id: 98cea1f971a4ef37ba2d1c75b882dd44df29bb3a
Summary:
Scaffolded desktop UI for UI debugger
I changed getroot from an rpc call to an event sent on connect. The root should never change as its the application object.
Reviewed By: lblasa
Differential Revision: D38866008
fbshipit-source-id: ca0f1908bedb643238f11ed796922e3359619167
Summary:
Introducing descriptors. Taken from the existing inspector, refreshed with a few things from Stetho, and translated to Kotlin.
Note: doesn't use FlipperObject or FlipperArray.
This is a very rough draft for them all, but can be used as basis for experimentation.
Reviewed By: LukeDefeo
Differential Revision: D38860763
fbshipit-source-id: 9f6bf4ad0e61fc40b0a773dfb8bfa80b1f397b3a
Summary:
Introduce ApplicationRef which holds a reference to Application. It exposes a few utility methods to get view roots and activities.
ApplicationInspector has a few template methods for useful things which are not used in this diff and most likely will either be moved/deleted/changed on the final implementation.
Reviewed By: LukeDefeo
Differential Revision: D38829523
fbshipit-source-id: b8aeb133dceb3af42b5f7d6851ef531d35fc7d69
Summary:
EnumMapping and InspectableValue taken from the original 'inspector' plugin but translated to Kotlin.
Accumulator is just a Map<String, Any>
Reviewed By: LukeDefeo
Differential Revision: D38823678
fbshipit-source-id: 6af395cab2e3e6930575eb63d22d660dab962fde
Summary:
folly::dynamic, std::string, implicit constructors and method overloading is not a good combination.
This renames the send method to sendRaw as to avoid issues with existing plugins currently sending string params.
Reviewed By: mweststrate
Differential Revision: D38827539
fbshipit-source-id: 653f62e41ebfbe93d1af25f39c81f6b05bf84cb4
Summary:
^
So far, we had the 'uidebugger' plugin as a meta-only plugin.
This change moves the plugin to OSS space as it will ultimately be its right place.
It will also make it easier to iterate on it.
The plugin itself is not ready for consumption but at no point we are documenting or integrating it with our samples.
Reviewed By: passy
Differential Revision: D38742336
fbshipit-source-id: 5cf124722fa7ba75ee9b998c507bfdfb2e4782c1
Summary:
For C++, folly::dynamic is used throughout.
On iOS and Android though, Flipper goes through multiple conversions to get to a folly::dynamic only to ultimately obtain a JSON string from it.
Let's take a look at Android:
There are multiple types like FlipperObject, FlipperArray that wrap around a JSONObject.
When data needs to be sent:
1. The JSONObject is asked for its string representation.
2. The string representation is then parsed by folly to construct the folly::dynamic instance.
3. The step above involves an extra boundary cross through JNI.
4. Ultimately, a socket or ws connection does not understand folly::dynamic so we then get a JSON string representation from it.
5. Data is sent.
As described above, for big enough objects, this represents an issue.
So, the idea of this change, is to allow plugins to send a JSON string instead. This will remove a few serialisation/deserialisation steps from the process.
*Note: this API is not currently used by anything so there's no impact to existing plugins.*
Changelog: expose a send method that accept a string as params
Reviewed By: LukeDefeo
Differential Revision: D38741582
fbshipit-source-id: 78e0acd80fc8c97378ee986cbaf377078996ed60
Summary:
Resolves https://github.com/facebook/flipper/issues/3926. Open to suggestions on the tag value, just sort of picked one that could be pointed to for anyone that wants to track these in their apps.
## Changelog
Tag sockets used by Flipper to fix strict mode warnings about untagged sockets.
Pull Request resolved: https://github.com/facebook/flipper/pull/3928
Test Plan:
Edit FlipperSampleApplication.java with the following:
```
public class FlipperSampleApplication extends Application {
Override
public void onCreate() {
StrictMode.setThreadPolicy(
new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build()
);
StrictMode.setVmPolicy(
new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog()
.build()
);
...
```
That will enable strict mode. Now build/launch the sample application.
Use adb logcat to inspect warnings:
```
adb logcat -s StrictMode
```
Without tagging the socket, the following warning should be observed:
```
D/StrictMode: StrictMode policy violation: android.os.strictmode.UntaggedSocketViolation: Untagged socket detected; use TrafficStats.setTrafficStatsTag() to track all network usage
```
After applying the fix, that warning should go away.
Reviewed By: lblasa
Differential Revision: D38280819
Pulled By: passy
fbshipit-source-id: 0c841b13237cbcb0ff8b8226fb44655a74b775c6
Summary:
A codemod removed a GK which resulted in this...
This change removes the unused code.
Reviewed By: mweststrate
Differential Revision: D38239893
fbshipit-source-id: 01163e9f5adcc77fff572b47ce1d902dbdadff4d
Summary: In a previous diff D32278523 (8764da7c0b) The desktop request was changed from send to call. Call expects a response and not all code paths return a response. Most calls to set highlight are timing out.
Reviewed By: mweststrate
Differential Revision: D38074704
fbshipit-source-id: 6e85416d6b6470efaa177ad1b74420c8237366d5
Summary:
Bumps core-ktx from 1.7.0 to 1.8.0.
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Pull Request resolved: https://github.com/facebook/flipper/pull/3794
Reviewed By: lawrencelomax
Differential Revision: D37070913
Pulled By: passy
fbshipit-source-id: 98f817ee76bde2dfec2ebf3eb5080214c746cdc4
Summary:
Apps usually communicate with multiple hosts to support pops and data centres. The problem currently is that for each host we need a different config in the mock tab in flipper. If the host change due to failover then the mocking stops working. Added support to enter the URL without a host in the flipper. We then check if the Url from the actual network request contains the mock URL without a host.
We can change the hint on flipper UI to suggest either entering the complete URL or without the host to allow matching across multiple hosts.
Resolve:[3751](https://github.com/facebook/flipper/issues/3751)
Let me know if the approach looks good.
## Changelog
Pull Request resolved: https://github.com/facebook/flipper/pull/3762
Reviewed By: lblasa
Differential Revision: D36780307
Pulled By: passy
fbshipit-source-id: 744898fa24d13343132e9a2165750241861245bd
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:
`getChilAt` can return `null` (see also line 671), probably when the UI changes during the inspection process. Added a null check that should protect against the failure reported in P501013941
Changelog: Fixed NPE during search in layout plugin (Android)
Reviewed By: lblasa
Differential Revision: D36369508
fbshipit-source-id: 1f066d1a73bdfe875d66f7200ded0d0776af8321
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:
^
:android:third-party task, on ocassions, gets parallelised with the :configureCMake task resulting in build errors.
:configureCMake depends on dependencies being in-place and patched.
Our current setup was achieving this via setting these tasks as dependencies of the preBuild task.
Unfortunately, this seems not be a bullet-proof solution.
This patch aims to improve this situation by ensuring the tasks are executed before :configureCMake. Whatever happens first.
Changelog: Execute :third-party:prepare before :configureCMake task on Android
Reviewed By: passy
Differential Revision: D36001637
fbshipit-source-id: 6c53b6852e40e354337c0ac940b5bbad4ef83078
Summary:
^
This change makes it clearer the order of tasks for the native libraries.
If unspecified, tasks will run in parallel.
There was an additional issue in which the revision could be written to disk before all dependencies are properly downloaded and packaged.
For reference, we depend on Folly.
Folly depends on:
- Double-Conversion
- Glog
- Boost
- LibEvent
This is now reflected in the tasks graph.
Reviewed By: passy
Differential Revision: D35931187
fbshipit-source-id: ec19a28521ebf318bd1e92feafab1671733679ca
Summary:
`AndroidFlipperClient.java` is a debug tool, and it has some strict mode violation.
We should exempt them to reduce noise on logcat.
- 1.
```
D StrictMode policy violation; ~duration=43 ms: android.os.strictmode.DiskReadViolation
D at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1596)
D at libcore.io.BlockGuardOs.access(BlockGuardOs.java:71)
D at libcore.io.ForwardingOs.access(ForwardingOs.java:72)
D at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:7578)
D at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:281)
D at java.io.File.exists(File.java:815)
D at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:681)
D at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:672)
D at android.app.ContextImpl.getFilesDir(ContextImpl.java:717)
D at android.content.ContextWrapper.getFilesDir(ContextWrapper.java:253)
D at com.facebook.flipper.android.AndroidFlipperClient.getInstance(AndroidFlipperClient.java:55)
```
- 2.
```
D StrictMode policy violation; ~duration=46 ms: android.os.strictmode.DiskReadViolation
D at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1596)
D at libcore.io.BlockGuardOs.read(BlockGuardOs.java:304)
D at libcore.io.ForwardingOs.read(ForwardingOs.java:176)
D at libcore.io.IoBridge.read(IoBridge.java:509)
D at java.io.FileInputStream.read(FileInputStream.java:320)
D at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
D at java.io.BufferedInputStream.read(BufferedInputStream.java:347)
D at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:291)
D at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:355)
D at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:181)
D at java.io.InputStreamReader.read(InputStreamReader.java:184)
D at java.io.BufferedReader.fill(BufferedReader.java:172)
D at java.io.BufferedReader.readLine(BufferedReader.java:335)
D at java.io.BufferedReader.readLine(BufferedReader.java:400)
D at com.facebook.flipper.android.FlipperProps.getFlipperPortsPropValue(FlipperProps.java:92)
D at com.facebook.flipper.android.FlipperProps.getFlipperDefaultAltPortsPropValue(FlipperProps.java:76)
D at com.facebook.flipper.android.FlipperProps.getAltInsecurePort(FlipperProps.java:37)
D at com.facebook.flipper.android.AndroidFlipperClient.getInstance(AndroidFlipperClient.java:47)
```
Reviewed By: nikoant
Differential Revision: D35784406
fbshipit-source-id: b55ce458e04a44d98565972132707a392d71281c
Summary:
This is a prototype for view preview within Flipper.
If enabled, a preview of the selected element is rendered in the attribute inspector.
Changelog: Add view preview/snapshot for the Layout plugin on Android.
Reviewed By: mweststrate
Differential Revision: D35009246
fbshipit-source-id: a442ff7f57093f463016811f0f451b52f579b448
Summary:
DefaultSqliteDatabaseProvider only list databases in the "files" folder & "databases" folder:
/data/user/0/com.facebook.wakizashi/files/
/data/user/0/com.facebook.wakizashi/databases/
On Messenger in Blue, msys database is located in the folder /data/data/com.facebook.wakizashi/app_mib_msys and therefore is not found automatically.
This patch makes the Database Flipper dolphin see the msys database by also listing the databases referred via extraDatabaseFiles.
Differential Revision: D35041276
fbshipit-source-id: e91b95fdc3bb31d414087cdea4a6825a98f3210a
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:
We shouldn't report an error when Flipper is querying data before Fresco is initialized.
This will be especially useful when we move to lazy Fresco initialization later this year.
Reviewed By: passy
Differential Revision: D33978177
fbshipit-source-id: dfb6cb1b73737adbb557ecb141b043d088b5a574
Summary:
Bumps appcompat from 1.4.0 to 1.4.1.
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Pull Request resolved: https://github.com/facebook/flipper/pull/3303
Reviewed By: lawrencelomax
Differential Revision: D33620944
Pulled By: passy
fbshipit-source-id: 6479b38aaa04d9791fa1a42937274c26a3831d7b