Commit Graph

62 Commits

Author SHA1 Message Date
Jakub Sokołowski 96ce65a350
bundle of desktop dependency upgrades
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-11-23 20:01:01 +01:00
Jakub Sokołowski 0c6cd948ad
upgrade multiple desktop deps
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-11-17 21:01:56 +01:00
Andrea Maria Piana c69863cda2
Fix message ordering and improve performance rec. messages
This commit does a few things:

==== Ordering of messages ====

Change the ordering of messages from a mixture of timestamp/clock-value to use
only clock-value.

Datemarks are now not used for sorting anymore, which means that the
order of messages is always causally related (not the case before, as we
were breaking this property by sorting by datemark), but datemark
calculation is unreliable (a reply to a message might have a timestamp <
then the message that is replied to).
So for timestamp calculation we
naively group them ignoring "out-of-order timestamp" messages, although
there's much to improve.
It fixes an issue whereby the user would change their time and the
message will be displayed in the past, although it is still possible to
craft a message with a lower clock value and order it in the past
(there's no way we can prevent this to some extent, but there are ways
to mitigate, but outside the scope of this PR).

==== Performance of receiving messages ====

The app would freeze on pulling messages from a mailserver (100 or so).
This is due to the JS Thread being hogged by CPU calculation, coupled
with the fact that we always tried to process messages all in one go.

This strategy can't scale, and given x is big enough (200,300,1000) the
UI will freeze.

Instead, each message is now processed separately, and we leave a gap
between processing each message for the UI to respond to user input
(otherwise the app freezes again).
Pulling messages will be longer overall, but the app will be usuable
while this happen (albeit it might slow down).
Other strategies are possible (calculate off-db and do a big swap,
avoiding many re-renders etc), but this is the reccommended strategy by
re-frame author (Solving the CPU Hog problem), so sounds like a safe
base point.

The underlying data structure for holding messages was also changed, we
used an immutable Red and Black Tree, same as a sorted map for clojure, but we use
a js library as is twice as performing then clojure sorted map.

We also don't sort messages again each time we receive them O(nlogn), but we
insert them in order O(logn).

Other data structures considered but discarded:
1) Plain vector, but performance prepending/insertion in the middle
(both O(n)) were not great, as not really suited for these operations.

2) Linked list, appealing as append/prepend is O(1), while insertion is
O(n). This is probably acceptable as messages tend to come in order
(from the db, so adding N messages is O(n)), or the network (most of
them prepends, or close to the head), while mailserver would not follow this path.
An implementation of a linked list was built, which performed roughtly the
same as a clojure sorted-map (although faster append/prepend), but not
worth the complexity of having our own implementation.

3) Clojure sorted-map, probably the most versatile, performance were
acceptable, but nowhere near the javascript implementation we decided on

4) Priority map, much slower than a sorted map (twice as slow)

5) Mutable sorted map, js implementation, (bintrees), not explored this very much, but from
just a quick benchmark, performance were much worse that clojure
immutable sorted map

Given that each message is now processed separately, saving the chat /
messages is also debounced to avoid spamming status-go with network
requests. This is a temporary measure for now until that's done directly
in status-go, without having to ping-pong with status-react.

Next steps performance wise is to move stuff to status-go, parsing of
transit, validation, which is heavy, at which point we can re-consider
performance and how to handle messages.

Fixes also an issue with the last message in the chat, we were using the
last message in the chat list, which might not necessarely be the last
message the chat has seen, in case messages were not loaded and a more
recent message is the database (say you fetch historical messages for
1-to-1 A, you don't have any messages in 1-to-1 chat B loaded, you receive an
historical message for chat B, it sets it as last message).

Also use clj beans instead of js->clj for type conversion

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2019-11-01 23:59:26 +01:00
Jakub Sokołowski f85ace651a
combined desktop dependency upgrades
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-10-30 11:43:13 +01:00
Jakub Sokołowski b8d3ef3aa5
combined node package upgrade prs
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-10-17 12:43:17 +02:00
Pedro Pombeiro e8627f0320
Allow Node.js packages to be upgraded by dependabot
- Move dev dependencies to `devDependencies`

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-10-04 12:12:36 +02:00
dependabot-preview[bot] d753f0d9b1
Bump react-native-gesture-handler in /desktop/js_filesBumps [react-native-gesture-handler](https://github.com/kmagiera/react-native-gesture-handler) from 1.3.0 to 1.4.1.- [Release notes](https://github.com/kmagiera/react-native-gesture-handler/releases)- [Commits](https://github.com/kmagiera/react-native-gesture-handler/compare/1.3.0...1.4.1)Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-10-04 11:42:13 +02:00
Volodymyr Kozieiev ace4b5a161
Desktop works with react-navigation v3
Signed-off-by: Volodymyr Kozieiev <vkjr.sp@gmail.com>
2019-10-02 10:19:37 +03:00
dependabot-preview[bot] a5a7f3f055 Bump qrcode from 1.4.1 to 1.4.2 in /desktop/js_files
Bumps [qrcode](https://github.com/soldair/node-qrcode) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/soldair/node-qrcode/releases)
- [Changelog](https://github.com/soldair/node-qrcode/blob/master/CHANGELOG.md)
- [Commits](https://github.com/soldair/node-qrcode/compare/v1.4.1...v1.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-24 09:58:01 +02:00
Pedro Pombeiro 699ac8c56e
Upgrade desktop yarn.lock
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-09-13 11:35:45 +02:00
Pedro Pombeiro e3e8e218ad
Make root folder less busy
- Move `mobile_files` into `mobile/js_files`
- Move `desktop_files` into `desktop/js_files`

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-09-12 16:54:12 +02:00
yenda c3dd950286
remove realm
Signed-off-by: yenda <eric@status.im>
2019-09-09 18:40:15 +02:00
Pedro Pombeiro 0f44a46f1f
Remove leftovers from before macOS pure build 2019-05-14 15:47:50 +02:00
Pedro Pombeiro fca01891ba
Improvements for a pure macOS Nix environment 2019-05-10 11:48:31 +02:00
Pedro Pombeiro 6eb806d2c1
Replace usage of stdenvNoCC.
- For Linux, the real fix is `hardeningDisable` of "fortify";
- For macOS, the real fix is setting the C and CXX compilers in `desktop/build.sh` as well as disabling CMake install step;
- Unfortunately for iOS we still need stdenvNoCC (or find a way to use GNU's ld instead of Apple's)

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-03-27 14:03:48 +01:00
Pedro Pombeiro f0cd54e65e
Fix missing artifacts in Windows build
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-03-22 14:30:52 +01:00
Pedro Pombeiro 3af25381e1
Change shebang in bash scripts 2019-03-21 13:57:00 +01:00
Pedro Pombeiro 2ac5ee019e
Migrate Desktop build environment to leverage Nix
- Add Conan to default.nix
- Integrate Qt5 Nix package (with forked repo for new QtWebView module)
- Fix rpaths in macOS and Linux
- Add Nix expressions to install nsis, appimagekit and linuxdeployqt
2019-03-21 13:56:58 +01:00
Pedro Pombeiro 9f9fae62a8
Minor changes in `build-desktop.sh` 2019-02-22 16:22:06 +01:00
Jakub Sokołowski b51b565cdb
add dockerimage for building android
- remove unused android-ndk toolchains
- add build.sh and test target for easy testing of image
- separate generic parts into a base image
- pass keystore credentials via env variables

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-01-16 17:36:13 +01:00
Pedro Pombeiro a458dfe1da
Lock down tool versions used in desktop Dockerfiles 2019-01-14 19:49:06 +01:00
Pedro Pombeiro 3437982f70
Lock down yarn version for local repo (currently 1.13.0) 2019-01-14 19:49:00 +01:00
Pedro Pombeiro 04f6782f1d
Lock down git dependencies 2019-01-14 19:48:56 +01:00
Pedro Pombeiro 9d21cf143e
Add Send Logs command. Closes #6710
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-01-08 09:48:56 +01:00
Pedro Pombeiro 583edc51f8
Simplify Linux bundle building
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-01-03 10:17:13 +01:00
Vitaliy Vlasov e40e495e11
Use QSettings in AppConfig
Some more changes

Changes

Fix review items

Rename init-settings to restore-native-settings

Restore application name (thanks @churik !)

Remove org name/domain setting for desktop

Change organization name to include domain

Re-use default values in :desktop/desktop

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2018-12-19 19:53:54 +02:00
Vitaliy Vlasov 9bc98405a0
Add react-native-desktop-config
Add section separator for logging-display

Refactor user-login-callback

Add comment to AppConfig class definition

Fix mobile compilation error

Use reference in AppConfig singleton; remove obsolete CMake directives

Styling changes

Disable status-go logs by default on desktop

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2018-12-18 14:31:40 +02:00
Vitaliy Vlasov 9afd76c7a8
Set REALM_DISABLE_ANALYTICS env var when running Node.JS server
Remove Jenkins change

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2018-12-14 12:50:44 +02:00
Volodymyr Kozieiev d603460ff1
Logging disabled for release build
Signed-off-by: Volodymyr Kozieiev <vkjr.sp@gmail.com>
2018-12-14 12:08:15 +02:00
Jakub Sokołowski 2586e71b30
move upload step top platform specific builds, cleanup
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2018-12-12 14:12:17 +01:00
Max Risuhin aea75a2de0
Prompt user explicitly to upload exact crash related files
Signed-off-by: Max Risuhin <risuhin.max@gmail.com>
2018-12-08 21:12:59 +02:00
Jakub Sokołowski 507a3fbeaa
bump nodejs version on desktop build docker images to 10
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2018-12-07 15:04:02 +01:00
Vitaliy Vlasov dc4841f041
Add react-native-desktop-menu native module
Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2018-12-01 02:03:06 +02:00
Igor Mandrigin 37ef82b04d
Use `yarn` instead of `npm` for package management. Lock dependencies.
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2018-11-29 16:29:57 +01:00
Vitaliy Vlasov 92d00f4250
Use multiple app instances simultaneously
Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2018-11-28 19:10:12 +02:00
Pedro Pombeiro a31d10f6dc
Add support for generating Windows install program instead of zip file. Part of #6304
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2018-11-20 15:11:24 +01:00
Pedro Pombeiro 5f2958ba9d
Lock down conan.cmake file version to avoid having upstream break our builds 2018-11-20 14:07:34 +01:00
Pedro Pombeiro 50200404ce
Ensure no ubuntu-server process is running at startup. Fixes #6584
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2018-11-19 13:26:37 +01:00
Vitaliy Vlasov c8278f0407
Fix QTROOT for clang64-based Qt
Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2018-11-15 14:09:57 +02:00
Pedro Pombeiro ff0613b0f8
Add Desktop app icon. Closes #5807
Signed-off-by: yenda <eric@status.im>
2018-11-14 17:28:09 +01:00
Pedro Pombeiro b8f6eb8d24
Configure Jenkins for Windows builds. Part of #5807 2018-11-14 17:16:32 +01:00
Pedro Pombeiro d0f78445d4
Windows port using Conan and MXE. Part of #5807 2018-11-14 17:16:29 +01:00
Jakub Sokołowski 7a1a8ba615
add pip3, it's necessary for cross-compiling for windows
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2018-11-09 09:13:13 +01:00
Pedro Pombeiro 4f401908c4
Improve ubuntu-server and `RCTStatus` logging. Part of #6593
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2018-11-06 20:28:02 +01:00
Max Risuhin 711f454c76
Non-bundle build logging to file support; Custom log path with STATUS_LOG_PATH env var.
Signed-off-by: Max Risuhin <risuhin.max@gmail.com>
2018-11-01 10:24:31 +02:00
Max Risuhin 5986761210
Push notifications support #4432; Rename app to Status globally.
Signed-off-by: Max Risuhin <risuhin.max@gmail.com>
2018-10-19 18:52:04 +03:00
Max Risuhin de6b7b1809
Set JS_APP_NAME to exported one from Status JS bundle
Signed-off-by: Max Risuhin <risuhin.max@gmail.com>
2018-10-04 23:32:54 +03:00
Jakub Sokołowski 4f9b2d91ea
upgrade QT for desktop to 5.11.2 (solves #6053)
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2018-10-03 11:49:52 -04:00
Jakub Sokołowski b03ffda01e
add python-dev to docker build image
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2018-09-28 12:55:59 -04:00
Vitaliy Vlasov 3147296209
Add doc for ENVTYPE setting
Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2018-09-28 13:05:42 +03:00