Commit Graph

5 Commits

Author SHA1 Message Date
Adhiraj Singh
30e2cb5c4c refactor: impl counter based event buffer
1. counter based event buffer keeps track of the number of blocks that request event processing in buffer
2. event buffer only releases events when the last block completes (i.e. counter = 0)

this approach is far simpler than the promised based garbled crap I wrote, should also prevent the deadlock issues it introduced 🙏
2022-12-02 11:31:42 +05:30
Adhiraj Singh
b520d81968 test: deadlock in event buffer 2022-11-26 00:55:45 +05:30
Adhiraj Singh
d0330d1863 refactor!: cleaner message history sync
This is a breaking change,
1. three events (chats.set, contacts.set, messages.set) are now just one `messaging-history.set` event
2. no need to debounce for app state sync
3. added a new "conditional" chat update to allow for correct app state sync despite not having the chat available on hand
2022-09-29 16:32:57 +05:30
Adhiraj Singh
d143ef0b7d feat: handle delete events accurately 2022-07-06 22:05:01 +05:30
Adhiraj Singh
7421f55daa 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
2022-06-27 13:38:29 +05:30