feat: implement event buffer for offline msgs

!BREAKING_CHANGE

1. this allows all offline notifications to be combined into a batch -- to reduce the number of events being sent out
2. to enable the above, the "message.reaction" event has been made an array. Also removes the need for the "operation" field
3. have also now started processing all events under a single queue to prevent state sync problems
This commit is contained in:
Adhiraj Singh
2022-06-27 13:38:29 +05:30
parent fd80448fcb
commit 7421f55daa
18 changed files with 945 additions and 367 deletions

View File

@@ -186,7 +186,12 @@ export type MessageContentGenerationOptions = MediaGenerationOptions & {
}
export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent
export type MessageUpdateType = 'append' | 'notify' | 'replace'
/**
* Type of message upsert
* 1. notify => notify the user, this message was just received
* 2. append => append the message to the chat history, no notification required
*/
export type MessageUpsertType = 'append' | 'notify'
export type MessageUserReceipt = proto.IUserReceipt