223 Commits

Author SHA1 Message Date
Roman Volosovskyi
c15a57571d
[#6956] fix possible message and user-status duplicates
There is a tiny chance that without this fix some users which had message
duplicates because of issues with `message-id` calculation **BEFORE** `0.9.31`
still have duplicates in their DB and migrations will not pass without
this change. It only checks if the message with a new `message-id` has been
added and removes duplicate. The same way it removes duplicates from
`user-status` entity.
2018-12-06 10:25:36 +02:00
Roman Volosovskyi
50a70f6e57
[#6956] store :raw-payload-hash in message (upgradable message-ids)
Currently, we calculate `message-id` as `sha3(from + raw_payload)`,
but we do not store `raw_payload` and it might be problematic
to restore it from DB because:
1) `content` field might be changed and so `Message` record
   will differ from the original one
2) it is even more problematic for `GroupMembershipUpdate`
   message because we don't save it in DB

In order to handle this, we can store `sha3(raw_payload)` as `raw-payload-hash`
prop of `message` entity and use it in case of emergency :)

`message-id` will be calculated as `sha3(from + sha3(raw_payload))`
2018-12-05 13:29:01 +02:00
Roman Volosovskyi
b6e515618b
[#6956] upgradable message-id
Implementation:
1. `transport.utils/message-id` function is called only in three places now
   and accepts `from` and  `raw_payload` as parameters.
   ID is calculated as `sha3(from + raw_payload)`.
2. This means that for wrapped private group chat message
   the raw payload of `GroupMembershipUpdate` is used.
2018-12-05 11:22:43 +02:00
Roman Volosovskyi
e7d0312d25
[#6903] fix replies compatibility
Issue was caused by https://github.com/status-im/status-react/pull/6722

Implementation:
1. `old-message-id` field (indexed) was introduced in `message` entity
   and is calculated as `message-id` was calculated in `0.9.31`
```clojure
(defn old-message-id
  [message]
  (sha3 (pr-str message)))
```
2. When a reply message is sent from the PR version of app both `response-to`
   and `response-to-v2` fields are sent as a part of `message`'s `content`
   field, so that it can be recognized by `0.9.31`.
3. When PR version of app receives reply from `0.9.31` we check whether
   message's `content` contains `response-to` but doesn't contain
   `response-to-v2`, and if so we check whether DB contains message with
   `old-message-id=response-to`. If such message has been found we assoc
   `response-to-v2` to content.
4. If message from DB contains only `response-to` but not `response-to-v2`
   attempt to fetch the message by `old-message-id` is done.
2018-12-05 07:22:40 +02: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
Roman Volosovskyi
c506521778
[slow sign in] Better handling of migration failures and db encryption problems.
Migration failures are handled separately from other errors which might appear
during opening account's realm DB. In case if user chooses to erase
the account's database, only this database will be removed and other accounts
will not be touched.
2018-11-28 14:13:30 +02:00
Roman Volosovskyi
5d5847e4b9
[slow sign in] Add unviewed messages counter to chat entity.
Before we fetched ALL user-statuses with `status=received` (which means that
a message hasn't been seen), iterated them, grouped by chat and then stored
`message-ids` of these `user-statuses` in chat's `:unviewed-messages` key.

This commit introduces :unviewed-messages-count field in chat entity.
That means that there is no need to iterate `user-statuses` in order to count
a total number of unviewed messages, it is always stored along with chat.
In the rest of it, the difference is only that chat's db record should be
updated each time when unviewed messages are seen.
2018-11-23 17:08:48 +02:00
Roman Volosovskyi
6ca3933b71
fix user-statuses after migration from #6722 2018-11-23 13:50:52 +02:00
Roman Volosovskyi
d66198a420
[slow sign in]
fix iterating over all messages from realm db (was done for deduplication)
async loading of chats (:init-chats event)
2018-11-21 18:21:52 +02:00
Roman Volosovskyi
1dcc7727f1
[slow sign in] faster :get-referenced-messages 2018-11-21 10:50:45 +02:00
Roman Volosovskyi
b792ab5cf3
[slow sign in] faster get-unviewed-messages 2018-11-21 08:04:33 +02:00
Goran Jovic
72e7ae2fff
feature #6509 - validating token config against their contracts; moved token info from compile time list to app-db; fixed any discrepancies in existing info
Signed-off-by: Goran Jovic <goranjovic@gmail.com>
2018-11-20 17:18:08 +01:00
yenda
b41df3b3c2
updating cljs compiler
Signed-off-by: yenda <eric@status.im>
2018-11-16 13:10:31 +01:00
Andrea Maria Piana
1104becfba
Enable syncing of contacts & style pairing section
Everytime a contact request is sent/confirmed a sync message is also
sent to other devices so the contact is kept in sync.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-11-14 13:21:14 +01:00
Aleksandr Pantiukhov
17f74ff2f6
[#6455]: Updated extension management
Signed-off-by: Aleksandr Pantiukhov <alwxndr@gmail.com>
2018-11-12 10:28:48 +01:00
Eric Dvorsak
f8f499d9b0
[refactor] rename whisper-id and whisper-identity to public-key 2018-11-09 11:16:27 +01:00
Eric Dvorsak
a6da75f8e9
[refactor] remove email field in account 2018-11-09 11:16:27 +01:00
Eric Dvorsak
4804d11b0f
[refactor] remove jail-loaded? and jail-loaded-events 2018-11-09 11:16:23 +01:00
Dmitry Novotochinov
ae3029c2d9
[#6294] add desktop alpha release warning
Signed-off-by: Dmitry Novotochinov <dmitry.novot@gmail.com>
2018-11-07 22:10:39 +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
Andrea Maria Piana
693eae9cf9
Send your own messages
Adds a `chat-id` field in `content` map.

The reason it has been added to the map instead of augmenting transit is
that it would simplify the calculation of `message-id`, which in this
case is consistent for both old & new clients.

`chat-id` also represents the `chat-id` with respect of the sender, as
in 1-to-1 chats that is asymmetric.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-11-06 21:19:50 +01:00
janherich
ff97345f07
Plug-in new text parsing engine 2018-11-06 19:59:24 +01:00
Andrea Maria Piana
7aa597517e
Add system messages to group chats
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-11-05 14:54:43 +01:00
yenda
bbf91468e7
[fix] add missing account schema in base schemas
Signed-off-by: Eric Dvorsak <eric@status.im>
2018-10-28 12:07:05 +01:00
Andrea Maria Piana
073dddcee0
Add pairing
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-10-27 20:43:53 +02:00
janherich
76165cc7cb
[#6460] [#6438] Deduplication-ids 2018-10-24 09:43:52 +02:00
Aleksandr Pantiukhov
5f06ebc27d
Temporary that makes it possible to install only one extension at a time (required for the hackathon)
Signed-off-by: Aleksandr Pantiukhov <alwxndr@gmail.com>
2018-10-22 15:01:39 +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
Aleksandr Pantiukhov
2c65077270
[#6382]: Makes extensions dev-mode aware
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
2018-10-19 16:37:46 +02:00
janherich
13eff1fb7e
Fix migrations 2018-10-18 17:31:15 +02:00
Aleksandr Pantiukhov
23503dc996
[#6094]: Persist extensions
Signed-off-by: Aleksandr Pantiukhov <alwxndr@gmail.com>
2018-10-17 14:08:45 +02:00
Andrea Maria Piana
09ca7d887c
Log db error
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-10-16 13:25:07 +02:00
yenda
647db6d698
hotfix realm migration
Signed-off-by: yenda <eric@status.im>
2018-10-15 21:53:40 +02:00
yenda
660bd2d1bd
request 7 days of history
- fetch 7 days of history when joining a chat
- make 7 24h requests to request 7 days because mailservers
ignores requests for a timespan > 24h
- make requests sequentially to avoid timeouts
- change mailserver after 3 timeouts on a request

Signed-off-by: yenda <eric@status.im>
2018-10-15 17:18:59 +02:00
yenda
1a2fcdfe3a
refactor contact models
- move models.contact and models.contacts to contact.core
- add tags field to contact and chat

Signed-off-by: yenda <eric@status.im>
2018-10-15 11:57:48 +02:00
yenda
efdd76b364
refactor inbox
Signed-off-by: yenda <eric@status.im>
2018-10-11 14:47:04 +02:00
Andrea Maria Piana
d3ed67e29b
Fix broken rebase
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-10-11 12:41:15 +02:00
janherich
99d33ebbc9
Always load messages referenced in responses 2018-10-11 11:21:34 +02:00
Andrea Maria Piana
84151ea996
Ignore messages with too high clock-value and prevent stored messages to pollute the database
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-10-09 14:34:29 +02:00
Andrey Shovkoplyas
17053019e3
fixed rebase mess with default-chat-color
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
2018-10-09 13:58:44 +02:00
Andrey Shovkoplyas
d32f15243d
colors refactoring
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
2018-10-09 13:26:42 +02:00
Andrea Maria Piana
78b6d67d79
Allow to edit group membership
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-10-09 10:40:13 +02:00
janherich
66ef32d3b9
Move all the legacy handling into transit 2018-10-08 21:00:59 +02:00
Andrea Maria Piana
165f1a46c7
Propagate signed membership information
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-10-02 12:06:28 +02:00
janherich
44fbe62773
Chat replies + refactoring 2018-09-28 16:15:47 +02:00
yenda
b8d250ba30
change realm schemas directory layout
the purpose of this change is to avoid the kind of mistakes that
happened in the past were copy/pasting imports led to wrong
migrations that went unnoticed
it will also make it easier to do migrations in the future as the
different versions of the same schemas are grouped together in the
same file and past migrations are grouped in the same file as well
so previous helper functions can be reused

Signed-off-by: yenda <eric@status.im>
2018-09-28 13:37:21 +02:00
Andrea Maria Piana
0c48d09c71
Add back group chats messages
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-09-26 20:58:03 +02:00
Andrea Maria Piana
df51731fca
Add pfs flag, installation id and nobackup data directory
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-09-24 17:47:02 +02:00
yenda
7dbc8a7f39
[fix 5814] fix custom network
Signed-off-by: yenda <eric@status.im>
2018-09-19 13:13:30 +02:00
Eric Dvorsak
d5fcc0b003
[FIX 5813] connect to custom mailserver button fix
Signed-off-by: yenda <eric@status.im>
2018-09-18 17:37:42 +02:00