Errors when generating a DH secret where silently ignored, resulting in
invalid key material being used.
This commit fixes the issue by upgrading the double ratchet library
and implementing the updated interface, which uses now slices instead of fixed bytes keys.
Currently there seem to be a bug with publishing the contact-code, and
each attempt result in the error `database is closed` (non-thread safe?). As discussed
previously we probably don't need to have fs persistence, so just
changing this to have it in memory.
This commit does a few things:
1) Add replies to messages, which are calculated at query time using a
join
2) Add a BlockContact api call that takes care of deleting messages from
a user, deleting the chat, and re-compute the denormalized values. As it
needs to run in a transaction, the method that it relies on take a
transaction as an optional parameter.
3) Change ID scheme for chats/contacts so that it's consistent across
messages/contacts
This is not compatible as I have modified a migration, but it's not a
problem as data compatibility can be broken
This commits adds two API calls:
SaveChat
GetChats
The first one behaves like an upsert.
The second takes two parameters, from, to and returns chats in reverse
order by timestamp.
Members and MembershipUpdates have been stored as blob of data to
simplify the querying (we never query them separately).
This commit adds the ability of reading and sending datasync messages.
Datasync messages are batched, so a single whisper message might
contain multiple protocol messages.
Datasync messages are parsed regardless of whether the datasync flag is
on, as this commit is backward compatible.
Sending messages is toggled off by default.
status-go requires some special methods to be exposed in order to support the current integration.
Introduced families of methods marked as `DEPRECATED`:
* `SendRaw` to send transit-encoded messages, both public and private. It supports only private PFS-enabled messages. To send private non-PFS messages, we can add this functionality or it needs to happen through `shh_post` directly from status-react.
* `RetrieveRawAll` and `RetrieveRawWithFilter` to get retrieve decrypted but transit-encoded messages.
* `LoadFilters` and `RemoveFilters` to manage Whisper filters directly.
* By default, persistence of messages is disabled. It can be enabled with an option passed to `Messenger`.
* File paths to the databases are configurable in `Messenger`.
We only generate the bundle once every 6 hours (or if pairing
information changes).
This means that in some cases where many devices appear/disappear,
new devices are not picked up until the bundle is refreshed.
For example:
Alice creates a device with timestamp t1 A1
Alice creates a device with timestamp t2 A2
Alice creates a device with timestamp t3 A3
Alice creates a device with timestamp t4 A4
Alice propagates this to bob, bob's list of active devices for alice is now: t2 A2,
t3 A3, t4 A4 as we only keep maximum 3.
If Alice sends a message to Bob from A1, previously it would be still
using t1 (as long as less than 6 hours have passed).
Now instead the new bundle will have t5 instead, so upon receiving the
message bob will have: t3 A3, t4 A4, t5 A1.
This commit changes the behavior to always update the timestamp before
publishing the bundle, so that as soon as a message is received from a
new device, it will increase the timestamp for that device.