The group call update message after starting a group call is currently only
sent in the onLocalDeviceStateChanged callback. But often the peekInfo is
not available yet when the connection state changes to Joined, effectively
preventing the group call update message to be sent.
This commit also sends the message in the onPeekChanged callback. It is still
only sent at most once, which is ensured by the updateMessageState check.
See [#5001][0].
[0]: https://github.com/signalapp/Signal-Desktop/pull/5001
* Merge report v1 group settings into local v2 group
The invariants of Storage Service mandate that the remote data always
takes precendence over the local data. We have to updated
blocked/whitelisted/... of the v2 group even if the record is for the v2
group. After doing such update - sync the manifest back to the Storage
Service with correct v2 record for the group.
* Repair errored records before uploading manifest
Fetch and re-attempt to merge errored records before uploading the
manifest. This is useful in the cases where we were not aware of the V1
group when the remote manifest was fetched, and became aware of it
before the new manifest is generated. In such scenario, we should fetch
the records for things we have failed on last time and attempt to merge
them with our data. If they are merged - we should not let their
storageIDs hang in the new manifest, which would cause group duplicates
and crashes on other clients.
* Create v1 group for storage service record
If we receive storage service record with v1 group that we didn't sync
yet (or just don't have for any other reason) - create it instead of
pushing it to `storage-service-error-records`.