Commit Graph

52 Commits

Author SHA1 Message Date
Andrea Maria Piana 1c63c782a4
Dont use network info but only rely on peers count for mailservers
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2019-11-05 11:50:54 +01:00
yenda 3528dd809a
fix fleet settings not being saved to node config
Signed-off-by: yenda <eric@status.im>
2019-11-01 11:56:11 +01:00
yenda 172038b70d
integrate mailserver-ranges api 2019-09-09 18:39:49 +02:00
yenda dbf8d60f8b
integrate status-go mailserver-topics api
Signed-off-by: yenda <eric@status.im>
2019-09-05 18:08:03 +02:00
yenda 1147466362
integrate status-go mailserver api 2019-09-05 18:07:17 +02:00
Andrea Maria Piana e7fa010088
Move gaps to status-go
This commit moves gaps to status-go.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2019-09-04 15:53:48 +02:00
yenda 1c475e5b1e
replace last remains of web3.js by json-rpc 2019-08-20 17:42:02 +02:00
yenda d7cd2b8a74
integrate status-go accounts 2019-08-20 17:42:02 +02:00
yenda c3c4a5170a
[multiaccount] rename multiaccount to account
Signed-off-by: yenda <eric@status.im>
2019-07-22 11:14:44 +02:00
Andrea Maria Piana 532664ab84
Adds topic negotiation and partitioned topic
All the code has been implemented in statusgo: status-im/status-go#1466

Basically all the whisper filter management is done at that level.

Technical description
On startup we load all chats and send a list of them to status go:
For a public chat: {:chatId "status"}, we create a single filter, based on the name of the chat.

For each contact added by us, each user in a group chat and each one to one chat open, we send:
{:chatId "0x", :oneToOne true}. This will create a chats, to listen to their contact code.

Any previously negotiated topic is also returned.

Once loaded, we create our filters, and upsert the mailserver topics, both of which are solely based on the filters loaded.
In order to remove a chat, we delete/stopwatching first the the filter in status-react and then ask status-go to remove the filter. For a public chat we always remove, for a one-to-one we remove only if the user is not in our contacts, or in a group chat or we have a chat open. Negotiated topics are never removed, as otherwise the other user won't be able to contact us anymore.

On stopping whisper we don't have to ask status-go to remove filters as they are removed automatically.

Some more logic can be pushed in status-go, but that will be in subsequent PRs.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2019-06-24 13:54:43 +02:00
Roman Volosovskyi 908f730b1d
[perf] network module 2019-06-13 09:33:18 +03:00
Roman Volosovskyi c7c7b50281
RAM bundle basic setup 2019-05-27 17:34:17 +03:00
Roman Volosovskyi f0a55dda3d
[#8080] Prevent extra gap in 1:1 chats on adding group chat 2019-05-02 17:05:00 +03:00
Andrey Shovkoplyas 428464df07
re-frame subscriptions optimization
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
2019-05-01 12:49:31 +02:00
Roman Volosovskyi c98f547349
Multiple messages gaps per chat 2019-04-24 22:33:08 +03:00
Roman Volosovskyi 5bd25515e4
Fix endless spinner on Fetch messages 2019-04-16 22:10:39 +03:00
Roman Volosovskyi 2753b0ef60
Skip fetching 24h of discovery topics on a new account
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2019-04-16 11:55:17 +02:00
Roman Volosovskyi a4d8f57b09
Fetch missed range of messages 2019-04-12 16:22:44 +03:00
bitsikka 6aae0b76b9
[#7454] fix add basic copy to public chat empty screen state + related issues/feature regarding chat message-views intro screens for all chats types
[#7454] fix add basic copy to public chat empty screen state + chat messages-views intro screens for all chats

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2019-04-04 12:34:37 +02:00
Vitaliy Vlasov 76c2ad2bc4
Add mailserver and bootnodes settings
Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2019-03-29 14:20:53 +02:00
Roman Volosovskyi 8f40f796f5
Add validation tooltip to mailserver/bootnode address input 2019-03-21 16:41:18 +02:00
Andrea Maria Piana dc0d42ee6b
Don't specify `to` when making the request to mailserver.
In some cases (say the clock of the device has drifted) specifying a `to` parameter
is decrimental and might result in missing messages.

We have changed the mailservers to default `to` if not present to `now`,
which should gives us better guarantees.

We also removed the 24 hours limit as now all the requests will be
paginated according to the `limit` parameter.

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2019-03-15 16:09:52 +01:00
Andrea Maria Piana b26b6ee5e0
Add unpinning of mailservers
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2019-03-04 14:06:09 +01:00
Andrea Maria Piana edf810444d
Fix concurrent retry-request
Sometimes it happens that the expired signal is received while the
there's a new request in flight.
This happens in cases such as:

1) We send a request (A)
2) We get disconnected from the mailserver
3) We connect to a new mailserver
4) We send a request (B)
5) We receive an expired signal for A

In such cases the request should not be retried or counted as a failure.

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2019-02-28 15:28:59 +01:00
Andrea Maria Piana 229f5ae108
Dont change mailserver if no network
When we are offline, we don't try to change mailserver, and we don't
show a pop up to the user, as it is not that the mailserver is not
working, we are just offline.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2019-02-26 15:32:54 +01:00
Andrea Maria Piana c56ef18ca9
Retry mailserver request when initial request fails
If the initial request fails we immediately show the error pop-up. This
PR changes the behavior so that it is retried just like any other
request. If 3 requests in a row fail, we show the error pop up if the
user has specifically set a mailserver, otherwise is changed
automatically.

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2019-02-25 21:43:15 +01:00
Andrea Maria Piana bcbaeb2cd9
Handle request error
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2019-02-19 13:39:02 +01:00
Pedro Pombeiro 40b3100cfc
Fetch messages from mailserver upon PN if db is unlocked. Part of #3451
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-02-13 23:28:44 +01:00
Roman Volosovskyi 48291247b2
Loading history on mobile network 2019-02-13 18:59:21 +02:00
Roman Volosovskyi 2ab1dcb54a
fix :request/attempts typo 2019-02-08 10:06:51 +02:00
Andrea Maria Piana 20550d022f
Adjuct mailserver limit when expired/complete events
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2019-02-07 08:30:44 +01:00
Andrea Maria Piana fd3152eeff
Retry mailserver request with cursor
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-02-06 11:46:20 +01:00
Roman Volosovskyi b96063ce56
[#7422] Show feedback on mailserver error 2019-02-05 20:51:09 +02:00
Igor Mandrigin 9cb890a32f
Increase mailserver page size 10 times to make initial sync faster.
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2019-02-05 14:51:08 +01:00
Roman Volosovskyi fe7c7088db
Use partitioned topic for discovery
Currently we use a single topic for discovery.
This provides the best obscurity at the cost of bandwidth, as a message
sent on the discovery topic will be received by any peer.
This PR changes this behavior and start listening on a partitioned
topic.
Each pk will be hashed to a limited number of topics.

Everytime someone is in a conversation with someone from another topic
they will have to listen as well to avoid loosing obscurity, because we
only forward messages that we also advertise in the bloom filter.

The choice for the number of partitions depends on 2 factors:

1) The expected number of users using the network
2) The average number of contacts each user

Any change to the discovery topic will need to be split across 3
releases, to avoid breaking compatibility:

1) Listen to the new and old topic, publish to the old topic
2) Listen to the new and old topic, publish to the new topic
3) Listen to the new topic, publish to the new topic

This is step 1.
2019-02-01 14:40:54 +02:00
yenda 8ef905edfb
[fix 5371] status bar covers touchable UI
- fix #5371
- fix #4345
- introduce "Connected..." status bar
- introduce fetching animation
- removes overlap of status bar with views
- add animations for status bar

Signed-off-by: yenda <eric@status.im>
2019-01-25 15:01:37 +01:00
Andrea Maria Piana 8be8f0b5c8
Adjust from value to accomodate for late-comers
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2018-12-17 14:57:49 +01:00
Andrea Maria Piana 05b70b0974
Use cursor and update status-go
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-12-14 13:11:31 +01:00
Andrea Maria Piana 6e5d54b5aa
Fetch history action 2018-12-14 13:10:37 +01:00
Rob Culliton a04952b60c
new json-rpc call for debug_metrics on advanced settings desktop tab;
include verify() bridge for desktop

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2018-12-13 16:27:26 +02:00
Andrea Maria Piana d760f1696c
Add mailservers confirmations & use peer count for online status
We now check that we are only connected to some `peers` instead of using `NetInfo` from `react-native`.

This is because it has been reported to be quite flaky at times, not reporting online status after sleeping, and for privacy concerns (on ios it pings `apple.com`, on desktop `google.com`).

Adds a new banner `Wallet Offline` and change `Connecting to peers` to  `Chat offline`.

A message will be marked as `Sent` only if it made it to the mailserver you are connected to, which will increase the guarantees that we can make about a message (if you see it as sent, it has reached at least a mailserver), this has the consequence that:

- If you are not connected to any mailserver or the mailserver is non responsive/down, and you send a message, it will be marked as `Not sent`, although it might have been actually made it in the network.

Probably this is something that we would like to communicate to the user through UX (i.e. tick if made it to at least a peer, double tick if it made to a mailserver )

Currently I have only enabled this feature in nightlies & devs, I would give it a run and see how we feel about it.
2018-12-12 19:53:01 +01:00
yenda 9110a64dcc
[fix] handle errorMessage in mailserver.request.completed signal
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2018-12-12 18:24:55 +01:00
Roman Volosovskyi 4aa562f6a8
[slow sign in] Unlock account's DB before starting node
There is no need to wait for `Statusgo.Login` callback in order to start
unlocking realm db: currently it is encrypted via a key which is derived
from user’s password, so we can try to unlock that DB before starting
node. That’s how password will be checked. Right after that `:home`
screen is shown, the node is started, then `Statusgo.Login` executed.

The difference in sign in duration is more noticeable on Android
devices, where `Statusgo.Login` is much slower because of PFS database
encryption.
2018-12-12 17:46:52 +02:00
Igor Mandrigin afc368b1b0
Upgrade status-go to 0.17.6-beta (Constantinople).
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-12-10 12:59:44 +01:00
Roman Volosovskyi e20af4d206
Do not update :mailserver/connection-checks` if the user is logged out.
Connection check should be skipped if the user has logged out, otherwise
`app-db` may end up in an invalid state which causes an error and red screen
in dev mode.
2018-12-08 20:56:41 +02:00
yenda 93db31d867
[6628] don't block message sending when mailserver disconnected
Signed-off-by: Dmitry Novotochinov <dmitry.novot@gmail.com>
2018-11-08 19:37:13 +03:00
yenda a3b2bc1b87
[fix #3913] do not logout when changing mailserver
- do not logout and remove previous mailserver
from peers when changing mailserver
- rename wnode mailserver
- move transport.inbox to mailserver.core
- fix all subs and db keys

Signed-off-by: yenda <eric@status.im>
2018-11-07 17:10:18 +01:00
yenda efdd76b364
refactor inbox
Signed-off-by: yenda <eric@status.im>
2018-10-11 14:47:04 +02:00
janherich 44fbe62773
Chat replies + refactoring 2018-09-28 16:15:47 +02:00
yenda 4bd5d986b0
remove merge-fx macro
Signed-off-by: yenda <eric@status.im>
2018-09-25 15:18:44 +02:00