2016-02-22 22:04:42 +00:00
|
|
|
{
|
2019-09-12 12:38:16 +00:00
|
|
|
"name": "StatusIm-Mobile",
|
2016-02-22 22:04:42 +00:00
|
|
|
"version": "0.0.1",
|
2022-05-19 15:50:41 +00:00
|
|
|
"main": "modules/react-native-status/nodejs/bindings.js",
|
2016-02-22 22:04:42 +00:00
|
|
|
"private": true,
|
|
|
|
"scripts": {
|
2019-09-07 12:57:22 +00:00
|
|
|
"start": "react-native start",
|
2020-11-25 09:30:00 +00:00
|
|
|
"ios": "react-native run-ios",
|
2022-06-06 10:24:38 +00:00
|
|
|
"preinstall": "make status-go-library",
|
2019-09-07 12:57:22 +00:00
|
|
|
"app:compile:android": "shadow-cljs compile android",
|
|
|
|
"app:watch": "shadow-cljs watch android",
|
|
|
|
"app:packager": "react-native start --host 0.0.0.0 --port 8081",
|
|
|
|
"app:android": "react-native run-android"
|
2016-02-22 22:04:42 +00:00
|
|
|
},
|
|
|
|
"dependencies": {
|
2022-06-28 17:27:14 +00:00
|
|
|
"@babel/preset-typescript": "^7.17.12",
|
2020-05-08 15:08:53 +00:00
|
|
|
"@react-native-community/async-storage": "^1.11.0",
|
2022-01-05 13:32:02 +00:00
|
|
|
"@react-native-community/audio-toolkit": "git+https://github.com/tbenr/react-native-audio-toolkit.git#refs/tags/v2.0.3-status-v6",
|
2022-07-14 11:57:04 +00:00
|
|
|
"@react-native-community/blur": "git+https://github.com/Kureev/react-native-blur#refs/tags/v3.6.1",
|
2022-01-05 13:32:02 +00:00
|
|
|
"@react-native-community/cameraroll": "git+https://github.com/status-im/react-native-cameraroll.git#refs/tags/v4.0.4-status.0",
|
2020-05-01 07:20:06 +00:00
|
|
|
"@react-native-community/clipboard": "^1.2.2",
|
2020-05-14 07:45:44 +00:00
|
|
|
"@react-native-community/hooks": "^2.5.1",
|
2020-02-25 11:31:04 +00:00
|
|
|
"@react-native-community/masked-view": "^0.1.6",
|
2019-10-14 05:24:35 +00:00
|
|
|
"@react-native-community/netinfo": "^4.4.0",
|
2020-06-12 08:54:28 +00:00
|
|
|
"@react-native-community/push-notification-ios": "^1.4.1",
|
2020-07-28 11:06:58 +00:00
|
|
|
"@react-native-community/slider": "^3.0.0",
|
2021-11-15 04:42:11 +00:00
|
|
|
"@walletconnect/client": "^2.0.0-beta.23",
|
2022-01-15 02:35:52 +00:00
|
|
|
"@walletconnect/client-legacy": "npm:@walletconnect/client@^1.7.1",
|
2022-01-05 13:32:02 +00:00
|
|
|
"bignumber.js": "git+https://github.com/status-im/bignumber.js.git#refs/tags/v4.0.2-status",
|
2019-09-09 17:25:02 +00:00
|
|
|
"buffer": "^5.4.2",
|
2019-09-06 10:05:26 +00:00
|
|
|
"chance": "^1.1.0",
|
2019-10-03 10:07:14 +00:00
|
|
|
"create-react-class": "^15.6.2",
|
2019-09-06 10:05:26 +00:00
|
|
|
"emojilib": "^2.4.0",
|
|
|
|
"eth-phishing-detect": "^1.1.13",
|
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": "^1.0.1",
|
2019-09-06 10:05:26 +00:00
|
|
|
"hi-base32": "^0.5.0",
|
|
|
|
"i18n-js": "^3.3.0",
|
2021-11-15 04:42:11 +00:00
|
|
|
"node-libs-react-native": "^1.2.1",
|
2019-08-29 10:47:39 +00:00
|
|
|
"qrcode": "^1.4.1",
|
2021-01-07 12:59:57 +00:00
|
|
|
"react": "16.13.1",
|
2019-10-03 10:07:14 +00:00
|
|
|
"react-dom": "^16.4.2",
|
2021-01-07 12:59:57 +00:00
|
|
|
"react-native": "0.63.4",
|
2019-09-06 10:05:26 +00:00
|
|
|
"react-native-background-timer": "^2.1.1",
|
2022-03-04 14:04:17 +00:00
|
|
|
"react-native-blob-util": "^0.13.18",
|
2020-07-30 12:58:00 +00:00
|
|
|
"react-native-camera-kit": "^8.0.4",
|
2022-01-05 13:32:02 +00:00
|
|
|
"react-native-config": "git+https://github.com/status-im/react-native-config.git#refs/tags/v1.4.2-status",
|
2019-10-03 10:07:14 +00:00
|
|
|
"react-native-dialogs": "^1.0.4",
|
2021-12-24 15:34:44 +00:00
|
|
|
"react-native-draggable-flatlist": "^3.0.3",
|
2022-01-24 13:18:01 +00:00
|
|
|
"react-native-fast-image": "^8.5.11",
|
2019-10-03 10:07:14 +00:00
|
|
|
"react-native-fetch-polyfill": "^1.1.2",
|
|
|
|
"react-native-fs": "^2.14.1",
|
2020-09-16 08:25:21 +00:00
|
|
|
"react-native-gesture-handler": "^1.8.0",
|
2020-03-05 07:01:30 +00:00
|
|
|
"react-native-haptic-feedback": "^1.9.0",
|
2022-01-05 13:32:02 +00:00
|
|
|
"react-native-image-crop-picker": "git+https://github.com/status-im/react-native-image-crop-picker.git#refs/tags/v0.36.2-status.0",
|
2020-07-17 14:09:36 +00:00
|
|
|
"react-native-image-resizer": "^1.2.3",
|
2022-01-05 13:32:02 +00:00
|
|
|
"react-native-image-viewing": "git+https://github.com/status-im/react-native-image-viewing.git#refs/tags/v0.2.1.status",
|
|
|
|
"react-native-keychain": "git+https://github.com/status-im/react-native-keychain.git#refs/tags/v.3.0.0-5-status",
|
2019-02-02 17:21:05 +00:00
|
|
|
"react-native-languages": "^3.0.2",
|
2020-09-15 08:12:10 +00:00
|
|
|
"react-native-linear-gradient": "^2.5.6",
|
2022-08-02 10:48:12 +00:00
|
|
|
"react-native-lottie-splash-screen": "^1.0.1",
|
2021-09-02 12:24:09 +00:00
|
|
|
"react-native-mail": "^6.1.1",
|
2022-05-09 10:20:37 +00:00
|
|
|
"react-native-navigation": "^7.27.1",
|
2020-07-28 11:06:58 +00:00
|
|
|
"react-native-permissions": "^2.1.5",
|
2021-11-15 04:42:11 +00:00
|
|
|
"react-native-randombytes": "^3.6.1",
|
2022-06-28 17:27:14 +00:00
|
|
|
"react-native-reanimated": "2.3.3",
|
2021-05-24 14:25:05 +00:00
|
|
|
"react-native-redash": "^16.0.11",
|
2020-05-14 07:45:44 +00:00
|
|
|
"react-native-safe-area-context": "^2.0.0",
|
2019-05-07 06:37:43 +00:00
|
|
|
"react-native-shake": "^3.3.1",
|
2021-08-30 22:51:19 +00:00
|
|
|
"react-native-share": "^7.0.1",
|
2022-01-05 13:32:02 +00:00
|
|
|
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.5.37",
|
2019-10-03 10:07:14 +00:00
|
|
|
"react-native-svg": "^9.8.4",
|
2019-05-30 14:01:20 +00:00
|
|
|
"react-native-touch-id": "^4.4.1",
|
2022-01-05 13:32:02 +00:00
|
|
|
"react-native-webview": "git+https://github.com/status-im/react-native-webview.git#refs/tags/v11.16.0-status",
|
2022-04-13 10:54:38 +00:00
|
|
|
"rn-emoji-keyboard": "git+https://github.com/status-im/rn-emoji-keyboard.git#refs/tags/v0.4.3",
|
2020-07-03 15:04:45 +00:00
|
|
|
"tdigest": "^0.1.1",
|
2019-09-06 10:05:26 +00:00
|
|
|
"web3-utils": "^1.2.1"
|
2019-07-03 19:00:51 +00:00
|
|
|
},
|
|
|
|
"devDependencies": {
|
2019-08-06 14:00:51 +00:00
|
|
|
"@babel/generator": "7.0.0",
|
|
|
|
"@babel/helper-builder-react-jsx": "7.0.0",
|
|
|
|
"@babel/plugin-transform-block-scoping": "7.0.0",
|
|
|
|
"@babel/preset-env": "7.1.0",
|
|
|
|
"@babel/register": "7.0.0",
|
2022-06-28 17:27:14 +00:00
|
|
|
"@mapbox/node-pre-gyp": "^1.0.9",
|
2019-09-07 12:57:22 +00:00
|
|
|
"clj-kondo": "^2020.1.13",
|
2019-07-03 19:00:51 +00:00
|
|
|
"coveralls": "^3.0.4",
|
2019-09-07 12:57:22 +00:00
|
|
|
"jest": "^25.1.0",
|
2022-05-27 08:35:43 +00:00
|
|
|
"nodemon": "^2.0.16",
|
2019-08-06 14:00:51 +00:00
|
|
|
"nyc": "^14.1.1",
|
2019-08-29 11:11:46 +00:00
|
|
|
"process": "0.11.10",
|
2022-01-05 13:32:02 +00:00
|
|
|
"rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#refs/tags/v2.0.2-status",
|
2020-07-09 10:13:28 +00:00
|
|
|
"shadow-cljs": "^2.10.14"
|
2022-05-19 15:50:41 +00:00
|
|
|
},
|
|
|
|
"binary": {
|
|
|
|
"module_name": "status_nodejs_addon",
|
|
|
|
"module_path": "./lib/binding/",
|
2022-07-17 12:37:46 +00:00
|
|
|
"host": "https://github.com/status-im/status-mobile/releases/download/",
|
2022-05-19 15:50:41 +00:00
|
|
|
"remote_path": "{version}"
|
2016-02-22 22:04:42 +00:00
|
|
|
}
|
2016-07-22 08:53:12 +00:00
|
|
|
}
|