2018-05-09 11:45:00 +00:00
|
|
|
{:name "StatusIm"
|
|
|
|
|
2018-07-26 11:22:15 +00:00
|
|
|
:run-options {:android {"appIdSuffix" "debug"}}
|
|
|
|
|
2018-08-23 01:54:29 +00:00
|
|
|
:figwheel-bridge "./figwheel-bridge.js"
|
2018-05-09 11:45:00 +00:00
|
|
|
;; JS modules
|
2019-09-09 17:25:02 +00:00
|
|
|
:js-modules ["buffer"
|
|
|
|
"bignumber.js"
|
2019-09-06 11:17:49 +00:00
|
|
|
"react-native-languages"
|
2019-02-02 17:21:05 +00:00
|
|
|
"i18n-js"
|
2018-05-09 11:45:00 +00:00
|
|
|
"dismissKeyboard"
|
|
|
|
"react-native-splash-screen"
|
|
|
|
"react-native-status"
|
2018-12-04 13:41:34 +00:00
|
|
|
"react-native-status-keycard"
|
2018-05-09 11:45:00 +00:00
|
|
|
"react-native-camera"
|
2019-08-29 10:47:39 +00:00
|
|
|
"qrcode"
|
2018-05-09 11:45:00 +00:00
|
|
|
"react-native-fs"
|
|
|
|
"react-native-dialogs"
|
|
|
|
"react-native-image-resizer"
|
|
|
|
"react-native-image-crop-picker"
|
2019-08-29 10:47:39 +00:00
|
|
|
"react-native-svg"
|
2018-05-09 11:45:00 +00:00
|
|
|
"react-native-webview-bridge"
|
2019-05-30 14:01:20 +00:00
|
|
|
"react-native-touch-id"
|
2018-08-11 02:39:58 +00:00
|
|
|
"web3-utils"
|
2018-05-09 11:45:00 +00:00
|
|
|
"chance"
|
|
|
|
"emojilib"
|
2018-09-10 15:07:54 +00:00
|
|
|
"eth-phishing-detect"
|
2018-05-09 11:45:00 +00:00
|
|
|
"react-native-config"
|
2019-06-20 16:14:56 +00:00
|
|
|
"react-native-screens"
|
2018-05-09 11:45:00 +00:00
|
|
|
"react-native-keychain"
|
|
|
|
"rn-snoopy"
|
|
|
|
"rn-snoopy/stream/bars"
|
|
|
|
"rn-snoopy/stream/filter"
|
|
|
|
"rn-snoopy/stream/buffer"
|
|
|
|
"react-native/Libraries/vendor/emitter/EventEmitter"
|
|
|
|
"react-native-background-timer"
|
|
|
|
"react-native-fetch-polyfill"
|
2019-01-31 10:55:09 +00:00
|
|
|
"react-navigation"
|
2019-07-05 09:05:36 +00:00
|
|
|
"react-native-navigation-twopane"
|
2019-04-30 05:18:05 +00:00
|
|
|
"hi-base32"
|
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-10-24 14:23:20 +00:00
|
|
|
"functional-red-black-tree"
|
2019-05-07 06:37:43 +00:00
|
|
|
"react-native-mail"
|
2019-09-03 10:51:53 +00:00
|
|
|
"react-native-shake"
|
2019-11-23 15:34:57 +00:00
|
|
|
"@react-native-community/netinfo"
|
|
|
|
"react-native-safe-area-context"]
|
2018-10-23 12:17:37 +00:00
|
|
|
;; Desktop modules
|
2019-09-09 17:25:02 +00:00
|
|
|
:desktop-modules ["buffer"
|
|
|
|
"bignumber.js"
|
2019-09-06 11:17:49 +00:00
|
|
|
"react-native-languages"
|
2019-02-02 17:21:05 +00:00
|
|
|
"i18n-js"
|
2018-10-23 12:17:37 +00:00
|
|
|
"dismissKeyboard"
|
|
|
|
"react-native-splash-screen"
|
|
|
|
"react-native-status"
|
2019-08-29 10:47:39 +00:00
|
|
|
"qrcode"
|
2018-10-23 12:17:37 +00:00
|
|
|
"identicon.js"
|
|
|
|
"react-native-fs"
|
|
|
|
"react-native-dialogs"
|
|
|
|
"react-native-image-crop-picker"
|
|
|
|
"react-native-webview-bridge"
|
|
|
|
"chance"
|
|
|
|
"emojilib"
|
|
|
|
"eth-phishing-detect"
|
|
|
|
"react-native-config"
|
|
|
|
"react-native-keychain"
|
|
|
|
"rn-snoopy"
|
|
|
|
"rn-snoopy/stream/bars"
|
|
|
|
"rn-snoopy/stream/filter"
|
|
|
|
"rn-snoopy/stream/buffer"
|
|
|
|
"react-native/Libraries/vendor/emitter/EventEmitter"
|
|
|
|
"react-native-fetch-polyfill"
|
|
|
|
"react-native-desktop-linking"
|
2018-11-28 19:36:39 +00:00
|
|
|
"react-native-desktop-menu"
|
2018-12-13 15:42:28 +00:00
|
|
|
"react-native-desktop-config"
|
2018-12-06 20:00:14 +00:00
|
|
|
"react-native-desktop-shortcuts"
|
2018-10-23 12:17:37 +00:00
|
|
|
"react-native-desktop-notification"
|
2019-10-01 17:52:20 +00:00
|
|
|
"react-native-desktop-gesture-handler"
|
2019-02-06 08:09:07 +00:00
|
|
|
"web3-utils"
|
2019-05-03 12:52:19 +00:00
|
|
|
"react-navigation"
|
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-10-24 14:23:20 +00:00
|
|
|
"functional-red-black-tree"
|
2019-07-05 09:05:36 +00:00
|
|
|
"react-native-navigation-twopane"
|
2019-02-06 08:09:07 +00:00
|
|
|
"hi-base32"]
|
2018-10-23 12:17:37 +00:00
|
|
|
|
2018-05-09 11:45:00 +00:00
|
|
|
;; Resoures
|
2018-10-23 12:17:37 +00:00
|
|
|
:resource-dirs ["resources/images"
|
2019-10-01 17:52:20 +00:00
|
|
|
"desktop/resources"]
|
2018-07-26 11:22:15 +00:00
|
|
|
|
|
|
|
:figwheel-options {:nrepl-port 7888
|
|
|
|
:nrepl-middleware ["cider.nrepl/cider-middleware"
|
|
|
|
"refactor-nrepl.middleware/wrap-refactor"
|
2018-09-15 10:19:49 +00:00
|
|
|
"cider.piggieback/wrap-cljs-repl"]}
|
2018-07-26 11:22:15 +00:00
|
|
|
|
|
|
|
:builds [{:id :desktop
|
2019-06-01 06:47:37 +00:00
|
|
|
:source-paths ["react-native/src/desktop" "src" "env/dev" "components/src" "dev"]
|
2018-10-24 14:31:16 +00:00
|
|
|
:compiler {:output-to "target/desktop/app.js"
|
2018-07-26 11:22:15 +00:00
|
|
|
:main "env.desktop.main"
|
|
|
|
:output-dir "target/desktop"
|
|
|
|
:npm-deps false
|
|
|
|
:optimizations :none}
|
|
|
|
:figwheel true}
|
|
|
|
{:id :ios
|
2019-06-01 06:47:37 +00:00
|
|
|
:source-paths ["react-native/src/mobile" "src" "env/dev" "components/src" "dev"]
|
2018-07-26 11:22:15 +00:00
|
|
|
:compiler {:output-to "target/ios/app.js"
|
|
|
|
:main "env.ios.main"
|
|
|
|
:output-dir "target/ios"
|
|
|
|
:npm-deps false
|
|
|
|
:optimizations :none}
|
|
|
|
:figwheel true}
|
|
|
|
{:id :android
|
2019-06-01 06:47:37 +00:00
|
|
|
:source-paths ["react-native/src/mobile" "src" "env/dev" "components/src" "dev"]
|
2018-07-26 11:22:15 +00:00
|
|
|
:compiler {:output-to "target/android/app.js"
|
|
|
|
:main "env.android.main"
|
|
|
|
:output-dir "target/android"
|
|
|
|
:npm-deps false
|
|
|
|
:optimizations :none}
|
|
|
|
:warning-handlers [status-im.utils.build/warning-handler]
|
|
|
|
:figwheel true}]}
|