Commit Graph

18 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
a589e88136 fix: do not add to pre-buffer if waiting for end 2022-11-26 00:37:38 +05:30
Adhiraj Singh
bcf33d786c chore: log mutex deadlocks 2022-11-25 22:00:25 +05:30
Adhiraj Singh
b20a3b9a6a chore: add timeout to log when buffer takes v long
helps debug deadlocks
2022-11-25 09:03:05 +05:30
Adhiraj Singh
211fd04b24 chore: add preBufferTraces for logging 2022-11-07 17:21:57 +05:30
Adhiraj Singh
a4a48a1969 feat: expose isBuffering 2022-11-07 09:28:46 +05:30
Adhiraj Singh
070e24e3fd fix: tsc issue 2022-10-24 11:38:57 +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
e7f6838fa4 chore: remove legacy code 2022-09-19 14:59:35 +05:30
Adhiraj Singh
8d6e00eab6 fix: handle when buffered tasks fail 2022-08-18 10:15:27 +05:30
Adhiraj Singh
665e461e83 feat: absorb existing message updates into upsert 2022-07-22 15:33:04 +05:30
Adhiraj Singh
40a1e268aa feat: add "strictNullChecks" 2022-07-09 10:20:07 +05:30
Adhiraj Singh
4c800b95d1 fix: only fire valid events 2022-07-07 15:37:01 +05:30
Adhiraj Singh
d143ef0b7d feat: handle delete events accurately 2022-07-06 22:05:01 +05:30
Adhiraj Singh
189b740ea6 chore: remove "treatCiphertextMessagesAsReal" flag
!BREAKING_CHANGE

This was generally a poor design decision on my part to add something like this -- primarily because it could increment the chat unread counter a 100 times for a single message
2022-07-04 11:38:17 +05:30
Adhiraj Singh
5cc58d4aed feat: add bulk "process" capability to BaileysBufferableEventEmitter 2022-07-04 11:34:41 +05:30
Adhiraj Singh
eaf0f37d24 refactor: use event-buffer for state sync resyncs 2022-06-27 14:51:26 +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