Commit Graph

258 Commits

Author SHA1 Message Date
John Knox
db833d36e9 Add max rsocket payload size
Summary:
We're seeing some crashes when attempting to send payloads larger than are supported by rsocket.
Instead of crashing, skip the message, but log it so we can see what it's containing.

This is where the failure occurs: https://github.com/rsocket/rsocket-cpp/blob/master/rsocket/framing/FramedDuplexConnection.cpp#L64

Reviewed By: passy

Differential Revision: D12857616

fbshipit-source-id: 2b02d7f5dd6499ba81783d3f8aefcbb64d9d408a
2018-10-31 11:14:56 -07:00
Pritesh Nandgaonkar
c938931b4f Add compiler flag for OSS builds
Summary: Currently we don't have a flag in iOS setup which lets us know if the code is going to be compiled in Open source or internally. Till now we didn't have a use case for it. But NT team is hacking a componentkit descriptor which is open sourced. This flag will come in handy for us to keep the open source setup build successfully.

Reviewed By: jknoxville

Differential Revision: D10854300

fbshipit-source-id: ac5da6f239b2066b6d7f0680cbfc1b7062ae0f36
2018-10-29 03:56:35 -07:00
John Knox
1be54ebee1 Add optional debug log switch
Summary:
This won't affect runtime, but is useful when debugging issues with flipper itself.
Setting this flag means all state changes will be output in logcat.

Reviewed By: passy

Differential Revision: D10231148

fbshipit-source-id: 7ddd490290ad973fc339b2f5f93a6f9a1fab4577
2018-10-25 04:14:37 -07:00
John Knox
57752533a6 Reconnect after desktop fails during cert exchange
Summary:
The code here is quite complicated so here's whats happening:

There's a disconnect hook, that waits and reconnects, so flipper never stops, except for the case where the desktop itself fails.

This makes some sense, but not total sense, as the client should really keep connecting, in case there's a different desktop that won't fail, or even if it was a transient failure.

Explicitly disconnecting, by setting the client to null, will trigger the disconnect hook and carry on the connect loop.

Reviewed By: passy

Differential Revision: D10231241

fbshipit-source-id: 90d823dce2221b1fb6501bd2797871dc1fb9770a
2018-10-24 10:37:16 -07:00
Pascal Hartig
881d066369 Flipper Release: v0.10.0
Summary: Featuring the new notification API. 🛎🎉

Reviewed By: jknoxville

Differential Revision: D10466460

fbshipit-source-id: 11a5bf9b83844bc623acd2dd9d7504dea2b61018
2018-10-19 09:25:28 -07:00
Pritesh Nandgaonkar
d89e559dbd Move QPL plugin to Background Plugin
Summary: Makes QPL iOS plugin to work in background

Reviewed By: jknoxville

Differential Revision: D10446049

fbshipit-source-id: 02ad6f6f83b13e326b6fdd8aa972fa7d29c76eb9
2018-10-19 06:49:47 -07:00
Pritesh Nandgaonkar
b367e38050 Flipper Release: v0.9.0
Summary: New Flipper Release: v0.9.0

Reviewed By: passy

Differential Revision: D10378915

fbshipit-source-id: 90e0c4fe7a7fb690f68afddc7781ff0c5bd35d15
2018-10-15 11:37:29 -07:00
Pritesh Nandgaonkar
5bbfa58909 Setup sdk for background plugin
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
2018-10-11 15:23:21 -07:00
Yevgeniy Miretskiy
963a59176f Classes with virtual methods ought to have virtual destructor
Summary: Classes with virtual methods (include pure virtual) should have virtual destructor.

Reviewed By: jknoxville, scottrice

Differential Revision: D10241087

fbshipit-source-id: c7d0d27e28da91648cda7bffb4f1a8772833332c
2018-10-09 09:55:47 -07:00
Alex Langenfeld
a54b542d17 use portable SysStat.h
Summary: for Windows

Reviewed By: passy

Differential Revision: D9886244

fbshipit-source-id: d82b4a76efd1c200096bb6d3573b527ba058bf0b
2018-10-03 14:29:59 -07:00
Pascal Hartig
fe0d1909cf Flipper Release: v0.8.1
Summary: Patch release to fix Android native library crashes.

Reviewed By: jknoxville

Differential Revision: D10084446

fbshipit-source-id: d40c47f91aa88d7a60b2d355ebdc7c14ffa77bbf
2018-09-27 08:27:08 -07:00
Pritesh Nandgaonkar
7e296467d2 Flipper Release: v0.8.0
Summary: New 0.8.0 release which includes name changes from sonar to flipper.

Reviewed By: passy, danielbuechele

Differential Revision: D10050160

fbshipit-source-id: 5394ea0d032cea39f40cc9ed8e0f054e506d4f04
2018-09-26 06:59:09 -07:00
Pritesh Nandgaonkar
ddcc74edb8 Update release script to accomodate name change
Summary: As per the title

Reviewed By: danielbuechele

Differential Revision: D10050043

fbshipit-source-id: 7e3744fd9d2224456515cfa7187faebbf1541fa6
2018-09-26 06:59:09 -07:00
John Knox
a19862d7a2 Cleanup "sonar" from logs
Summary: Flipper logs already get "Flipper" prepended.

Reviewed By: passy

Differential Revision: D10028565

fbshipit-source-id: d3e84bba64044275da0145db6e804dc8eb3a44b7
2018-09-25 07:57:34 -07:00
John Knox
f35ca982bf Change CSR subject from sonar to flipper
Summary: This shouldn't have any effect on anything, it doesn't need to be any particular value.

Reviewed By: danielbuechele

Differential Revision: D9944462

fbshipit-source-id: f84c70b3cd18fdfe1d41f07b5b0ede2fdec3f44a
2018-09-25 04:57:48 -07:00
John Knox
1a076f1300 Rename C++ fields and internal methods
Summary: From sonar* to flipper*.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9944461

fbshipit-source-id: 870997e3d1d5aaef73dd445e6d94615f93fe6abc
2018-09-25 04:57:48 -07:00
Pascal Hartig
c7b0d419cb Rename libsonar* to libflipper*
Summary: Rename the native libraries.

Reviewed By: priteshrnandgaonkar

Differential Revision: D10009245

fbshipit-source-id: 987c4fdb1acc21abbbecfb3db8a672f4aa4e499d
2018-09-25 04:02:29 -07:00
Pascal Hartig
656f7cc626 Fix xplat build
Summary: We are referencing a no longer existing folder.

Reviewed By: priteshrnandgaonkar

Differential Revision: D10009244

fbshipit-source-id: 710c363fdeaf4f8621eb5f5d0bde2cbd4295ae64
2018-09-24 07:50:39 -07:00
John Knox
c4d12c21d9 Rename Mock classes
Summary: Part of sonar to flipper rename

Reviewed By: priteshrnandgaonkar

Differential Revision: D9929102

fbshipit-source-id: 88cdbd33aa5c76e386449f54f4eb8c6435865ed1
2018-09-24 07:00:45 -07:00
John Knox
c18c8ac802 Rename Sonar Tests
Summary: Part of sonar to flipper rename

Reviewed By: passy

Differential Revision: D9929101

fbshipit-source-id: f33e1ac7f88fbe88a9d48180d064b596603a3c58
2018-09-24 07:00:44 -07:00
John Knox
8ae77810d9 Rename SonarStep
Summary: Part of sonar to flipper rename

Reviewed By: passy

Differential Revision: D9920275

fbshipit-source-id: 02f97d1e51d58864283d26e8d3a724cac973e938
2018-09-24 06:03:51 -07:00
John Knox
c1295b1bc9 Rename SonarState* to FlipperState*
Summary: Part of sonar to flipper rename

Reviewed By: passy

Differential Revision: D9919821

fbshipit-source-id: a44a2a04d5463750f884f8bf1328e02d56593e82
2018-09-24 06:03:51 -07:00
John Knox
1d2793f701 Rename SonarWebSocket
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
2018-09-24 06:03:51 -07:00
John Knox
2a822a1b99 Rename SonarResponderImpl
Summary: Part of sonar -> flipper rename

Reviewed By: passy

Differential Revision: D9918894

fbshipit-source-id: 066042b18e68a4e92308388e4cc7a29584010111
2018-09-24 06:03:51 -07:00
John Knox
5350d3ce7a Rename C++ SonarPlugin class
Summary: Part of sonar -> flipper rename

Reviewed By: passy

Differential Revision: D9917615

fbshipit-source-id: e59f43bf003d30ae6be4d95bc4a21c92ab39f732
2018-09-24 06:03:50 -07:00
John Knox
574c05c41d Rename SonarInitConfig
Summary: Part of sonar -> flipper rename

Reviewed By: priteshrnandgaonkar

Differential Revision: D9908472

fbshipit-source-id: f2e694b5abfa22a745ee4719d24d6aad8af6ee2a
2018-09-20 17:06:55 -07:00
John Knox
9889df3f3c Rename SonarConnection to FlipperConnection
Summary: Part of Sonar -> Flipper rename

Reviewed By: passy

Differential Revision: D9907353

fbshipit-source-id: 01f7bb84da1c27fd68d608151f437a18b6eaaa4e
2018-09-20 17:06:54 -07:00
John Knox
3c656de7fa Rename SonarClient to FlipperClient
Summary: Part of the Sonar -> Flipper rename

Reviewed By: passy

Differential Revision: D9871902

fbshipit-source-id: 4b64953cb1a64235d47caaf0fabfb560bb85f7a2
2018-09-20 17:06:53 -07:00
John Knox
df8763e697 Move xplat/sonar/xplat/Sonar* to Flipper*
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
2018-09-20 15:39:57 -07:00
Pascal Hartig
cc6f28f7c4 Link static libraries statically (#277)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/277

Link all dynamically loaded libraries statically with the exception of libevent.

Reviewed By: jknoxville

Differential Revision: D9967422

fbshipit-source-id: b33cec5da0c2b34f47217353f205b9d77f1acae2
2018-09-20 09:35:19 -07:00
Pritesh Nandgaonkar
e763c5cd15 Suppress crash due to Flipper Plugins
Summary: This diff wraps the call to refresh plugins in `performAndReport`. All the important methods are already wrapped in this function. This diff also logs the error in the standard error if the connection is not established. With this diff the iOS app should not crash due exceptions thrown in iOS and cpp code. For android the app won't crash due to exception of cpp but can crash due to exceptions thrown in java code of the plugin

Reviewed By: jknoxville

Differential Revision: D9848112

fbshipit-source-id: 689ef9240e47400e8ce8c89b4c0ccec43d2180f9
2018-09-20 03:57:13 -07:00
Daniel Büchele
0d33f7afd6 revert CA file name to sonar
Summary: as per title

Reviewed By: jknoxville

Differential Revision: D9927180

fbshipit-source-id: d4e0a6e3da4babeda4a04c1081878b962a091c3f
2018-09-18 17:27:21 -07:00
John Knox
9d9fa17134 Rename all The c++ JNI classes
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/272

Reviewed By: passy

Differential Revision: D9861432

Pulled By: jknoxville

fbshipit-source-id: 523b8fc28541b922bbcc0939514f4ddd0a3fc1b0
2018-09-18 07:27:28 -07:00
John Knox
a480be90a2 Rename facebook::sonar namespace
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/271

Reviewed By: passy

Differential Revision: D9861393

Pulled By: jknoxville

fbshipit-source-id: d65f751c35028748915023f33f273d6ec45863c8
2018-09-18 07:27:28 -07:00
Daniel Büchele
3e4c24d6fe certificateProvider
Summary: rename certificate provider

Reviewed By: passy

Differential Revision: D9871288

fbshipit-source-id: 001a61416af23d89e63374cccc3df256b55eb6d2
2018-09-18 07:01:17 -07:00
Pritesh Nandgaonkar
bc3ccfce5d Flipper Release: v0.7.2
Summary: New Flipper Release

Reviewed By: passy

Differential Revision: D9850680

fbshipit-source-id: 50a8251fd2ddc2c6ca57f8a87ee1943f46f7559d
2018-09-17 05:57:32 -07:00
Pritesh Nandgaonkar
0ac03b74cc Flipper Release: v0.7.1
Summary: Flipper Release: v0.7.1

Reviewed By: jknoxville

Differential Revision: D9829332

fbshipit-source-id: fb8099a16d6bc3e68be7d0e69fdeb69281492ea6
2018-09-14 05:41:58 -07:00
Pritesh Nandgaonkar
9a16d9cbad Update rsocket version
Summary: Updates rsocket version

Reviewed By: passy

Differential Revision: D9769468

fbshipit-source-id: b822e697446b1464b63206869726e0e086438134
2018-09-13 03:12:35 -07:00
Pritesh Nandgaonkar
27cbf7f995 Flipper Release: v0.7.0
Summary: New release

Reviewed By: passy

Differential Revision: D9789625

fbshipit-source-id: 799206eafa0db54bdcb67de3854dba395326de7c
2018-09-12 09:13:35 -07:00
John Knox
869c785c71 Store empty connection_config in legacy CSR requests
Summary:
Versions of flipper from before 7th August 2018 don't return any response, so we don't store any connection_config.json file.
To keep the functionality the same as with up-to-date app versions, when this happens, store an empty config file ("{}").

Reviewed By: danielbuechele

Differential Revision: D9682885

fbshipit-source-id: fd580f6bba6b6b20135aa2c076be10e1eea0f8bc
2018-09-06 10:13:25 -07:00
John Knox
d16fd8cfae Handle json parse failures
Summary: Loading the deviceId is not critical, so if it ever fails, we can live with that by swallowing the exception and using the default (possibly 'unknown' deviceId).

Reviewed By: danielbuechele

Differential Revision: D9682886

fbshipit-source-id: e5d60dd262fce683dd444167edd1475e0c029759
2018-09-06 10:13:25 -07:00
John Knox
9939a9e3bb Factor out SONAR_LOG
Reviewed By: passy

Differential Revision: D9555739

fbshipit-source-id: 022763ea03047e1c4cd88d5f389b66be4cbe416b
2018-09-03 11:12:28 -07:00
John Knox
243b4207e7 Change string macros to static constexpr
Summary: There's no need for these to be macros.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9555471

fbshipit-source-id: a78d6cdb4ceb1830f749eda50e0e07ebc55723bf
2018-09-03 11:12:28 -07:00
John Knox
afea2f63ec Extract file system interaction from SonarWebSocketImpl
Summary:
SonarWebSocketImpl has got pretty bloated. So I'm extracting all the file interaction out of it into
ConnectionContextStore. The purpose of this class is to provide all the context needed to establish a connection.
This makes SonarWebSocketImpl more functional and therefore testable.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9540089

fbshipit-source-id: 0cd1d69f2b11eaf9f569245a2da14f85cc140427
2018-09-03 11:12:28 -07:00
John Knox
a5af72a169 Reject null event base arguments
Summary:
If you use a null eventbase, folly implicitly decides which one to run the futures in, for example
the timekeeper thread.
The only component that passes in event bases is sonar.cpp.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9539443

fbshipit-source-id: 7fd7289257c84b039a7ac00b14f78bb271262480
2018-09-03 11:12:28 -07:00
John Knox
edff177c3f Give serial to the device during cert exchange so it can provide it whenever it connects
Summary:
Android devices don't always know their own serial.
But we do a certificate exchange using adb from the desktop, so we can provide it in the response.

After this the client will provide it every time it connects, so we can do things like filter plugins by device id.

For apps that have already done cert exchange, they'll continue to use 'unknown' as their id until they do it again with an up to date version of sonar.
We can think about forcefully stopping that, but I haven't done it.

Reviewed By: danielbuechele

Differential Revision: D9481460

fbshipit-source-id: f8932699711ebbec4260fabe32f87e6cdff920f2
2018-08-31 08:12:56 -07:00
Pascal Hartig
02cf3a90a2 Fix build caching (#242)
Summary:
See https://github.com/facebook/flipper/issues/230 for a longer
explanation.

It turns out that many of the tasks in `native.gradle` (at least
`prepareGlog` which modifies files inside the source directory, but also
others) cause the cmake cache to invalidate.

Because we run those tasks unconditionally, we need to recompile all our
C++ code even when unmodified.

I fix this by adding a manual cache key to this which simply skips all
the tasks unless an up-to-date `external_cache_revision.txt` is found.
This is a bit hacky, but the alternatives are a) convincing cmake that
these modifications are not recompile-worthy which I have no idea how to
do and which might be impossible to do `mtime` on the files touches, or
b) having fine-grained `onlyIf` rules for every task which can easily
break. This seems the most straight-forward option.

Fixes #230.
Pull Request resolved: https://github.com/facebook/flipper/pull/242

Reviewed By: jknoxville

Differential Revision: D9381340

Pulled By: passy

fbshipit-source-id: a7db55aacac4a29076c29298d6c5b97d8bc91f66
2018-08-20 07:43:47 -07:00
Aaron Brady
e9471c7197 fix crash if SonarClient is stopped with no connection
Summary: calling SonarClient::instance()->stop() without a connection will try to deref a null client_

Reviewed By: jknoxville

Differential Revision: D9325527

fbshipit-source-id: b0a81d6eb9d1375b74cbf10466f947e8a2de3b98
2018-08-17 10:14:10 -07:00
John Knox
e76a6ef529 Document SonarStep.h
Summary: It may not be immediately obvious how this works, so adding comments.

Reviewed By: passy

Differential Revision: D9333321

fbshipit-source-id: 79740b3d2a9589b3ba48c47b0068afdaf26f35a3
2018-08-15 06:12:30 -07:00
John Knox
38391ca29e Allow steps to fail with error message
Summary:
Add a method to add error messages into failed steps. This will be surfaced in the diagnostic screen, to help the user
troubleshoot.

Reviewed By: passy

Differential Revision: D9333322

fbshipit-source-id: 5f1e55c3d71b19292dbc428aaecfbd41e7a75125
2018-08-15 06:12:30 -07:00