Commit Graph

50 Commits

Author SHA1 Message Date
Paulo Victor Lund ae0cb89714 Session recreation and improved message retry (#1735)
* Add message retry manager for session recreation and caching

Introduces a MessageRetryManager to cache recent sent messages and manage automatic Signal session recreation for failed message retries. Adds new config options to enable these features, integrates retry manager into message send/receive logic, and provides periodic cache cleanup. Improves reliability of message delivery and retry handling.

* Add buffer timeout and cache limit to event-buffer

Introduces a buffer timeout to auto-flush events after 30 seconds and limits the history cache size to prevent memory bloat in event-buffer.ts.

* Add session validation to SignalRepository

Introduces a validateSession method to SignalRepository for checking session existence and state. Updates message retry logic to use the new validation, improving session recreation handling and retry management.

* Improve message retry management and tracking

Refactored message retry manager to use LRU caches for recent messages and session history, added retry counters and statistics tracking, and implemented phone request scheduling. Updated message receive and send logic to mark retry success and pass max retry count. Removed periodic cleanup logic in favor of cache TTLs for better resource management.

* lint fix

* Use validateSession for session checks in message send

Replaces direct session existence checks with the improved validateSession method, which also checks for session staleness. Adds debug logging for failed session validations to aid troubleshooting.

* Delete src/Utils/message-retry.ts

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2025-09-07 20:20:51 +03:00
vini 50fc83b008 feat(business): change profile/cover photo and manage quick replies (#1724) 2025-09-07 14:08:26 +03:00
vini aba3ecf969 feat: add enable/disable link preview privacy (#1675) 2025-08-07 01:50:24 +03:00
Rajeh Taher 8dc852ee89 proto: fix proto generation, tsc: fix node imports of compiled code 2025-07-19 23:16:35 +03:00
vini 19124426b2 [feat]: add/edit/remove contacts (#1172)
* add/edit/remove contacts

* use proto type in contact action

---------

Co-authored-by: canove <cassio@economicros.com.br>
2025-07-09 22:01:20 +03:00
Rajeh Taher 719a57b275 Added message range to the clear chat action (#1534)
* chat-utils: Added message range to the clear chat action

* Chat: add field to type (thanks @Kiss from discord)

* Update src/Utils/chat-utils.ts
2025-07-05 23:58:44 +03:00
canove fa706d0b50 chore: format everything 2025-05-06 12:10:19 -03:00
Rajeh Taher 98ecd2a653 usync, chat: get bot profile info and get bot list 2025-03-19 00:44:53 +02:00
Bob 1d88166613 Feat: Block messages from unknown numbers (#1071)
* Update Chat.ts

* Update chats.ts

* lint

* lint

* lint
2025-03-01 18:20:22 +02:00
Rajeh Taher 647f8d767f chat-utils: fix the clear chat chat mod 2024-10-14 02:52:23 +03:00
建辉 6ff945502d feat: add label feature (#955)
Co-authored-by: 刘建辉 <liujianhui@gongchang.com>
2024-09-22 14:48:17 +03:00
arthur simas ffafc167fb fix: remove 'none' from updateGroupsAddPrivacy (#966)
* fix: remove 'none' from updateGroupsAddPrivacy

* fix(fix/remove-none-groupadd): linting

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2024-08-14 12:16:12 +03:00
Bob d396a03e65 Feat: Mute unknown calls (privacy) (#872)
* Update Chat.ts

* Update chats.ts

* export

* fix sort
2024-07-03 10:34:27 +03:00
Rafael Garcia 3ac29e131d Slint fixes applied 2023-05-15 09:41:33 -05:00
Rafael Garcia 38f285760d feat(labels): modify chat utils 2023-05-14 12:44:19 -05:00
✬Ravindu Manoj✬ ✓ 13810ec7ea feat: privacy settings update functions and profile pic remove function (#5) 2023-05-06 15:10:43 -03:00
Adhiraj Singh 34f8f60d31 chore: lint 2023-02-21 11:49:59 +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 e08dd10198 refactor!: use proto.Conversation's own chat mutation fields instead of baileys added 2022-09-29 11:06:09 +05:30
Adhiraj Singh c20865dff1 fix: correctly set latest message in chat + lastMsgRecvTimestamp 2022-09-11 11:07:12 +05:30
Adhiraj Singh c76c2afa0c feat: add "receivedInitialSync" connection update 2022-08-19 10:48:27 +05:30
Adhiraj Singh 2549d10be9 feat: update proto
The new proto extract has a bunch of breaking changes, so if you were using the raw proto in your code somewhere -- then you may have to update your code to make it work with the new proto

!BREAKING_CHANGE
2022-08-01 10:43:04 +05:30
LeonardoBein b42be6bce4 Change profile name for yourself (#1913)
* feat: change profile name

* fix: unnecessary return
2022-07-21 15:56:51 +05:30
Adhiraj Singh eaf0f37d24 refactor: use event-buffer for state sync resyncs 2022-06-27 14:51:26 +05:30
Adhiraj Singh baa3919a17 chore: add back "messages" to chat 2022-06-24 12:23:50 +05:30
Dwi Rizqi e7087cabf5 fix: Delete Message For Me (#1718)
* Add Timestamp for deleteMessageForMe

* Fix Typo Readme

* Add Timestamp for deleteMessageForMe

* fix: Typo type timestamp
2022-06-13 20:13:52 +05:30
Adhiraj Singh f87f89329b perf: avoid excess memory usage when syncing state 2022-06-11 20:25:57 +05:30
Adhiraj Singh 5cb71ac862 feat: more accurately handle app state sync 2022-06-11 12:02:08 +05:30
Adhiraj Singh 5305730d82 feat: track history being stored
This is done because sometimes we receive history after the first connect too, and to ensure the "isLatest" flag is accurate -- we ensure no history was received previously
2022-06-07 21:18:51 +05:30
Adhiraj Singh 6ee60bff67 chore: add ability to specify ISyncActionMessageRange directly 2022-04-28 16:26:23 +05:30
Adhiraj Singh dba6d2e0cb fix: do not throw error on conditions not matching in lastMessage check 2022-04-28 15:24:10 +05:30
Adhiraj Singh de7d1002a9 lint: stricter linting rules 2022-03-01 16:32:14 +05:30
Adhiraj Singh 8f11f0be76 chore: add linting 2022-01-19 15:54:02 +05:30
Adhiraj Singh d15bde5d17 refactor: app state handling
1. fixes snapshot patches not being included
2. fixes all mutations being passed when syncing from scratch
3. simpler chat mutation model
4. do not retry if key is not found
2022-01-07 14:29:52 +05:30
burstfreeze 98af4a6624 Fix #1010 by asking for full list of sync states when needed (#1043)
* Process patches that are longer.

* Fixed type declaration

* Changed resync behavior from recusive to iterative

* refactor: cleaner handling of hasMorePatches

Co-authored-by: Adhiraj Singh <adhirajsingh1001@gmail.com>
2021-12-22 20:57:58 +05:30
Adhiraj Singh 4710f6603a fix: delete chat on legacy 2021-12-21 17:21:25 +05:30
Adhiraj Singh c87d8b8129 refactor: update chat modifications to be uniform across MD + legacy 2021-12-21 10:53:39 +05:30
Adhiraj Singh 19a9980492 feat: add legacy connection 2021-12-17 19:27:04 +05:30
Adhiraj Singh c07c013a90 refactor: specify pin mutation with boolean 2021-11-25 13:51:43 +05:30
Adhiraj Singh 032b2a314b refactor: include full sync action in chatmutation 2021-11-25 13:37:05 +05:30
Adhiraj Singh 7b42fa5a54 fix: correct operation type on chat patch 2021-11-25 00:37:44 +05:30
Adhiraj Singh 173d1ddf8b implement chat modifications 2021-09-29 12:31:22 +05:30
Adhiraj Singh 1a83a4c6d4 nicer patch API 2021-09-28 19:33:21 +05:30
Adhiraj Singh fdfe310fdf implement encrypting app patches 2021-09-28 19:22:39 +05:30
Adhiraj Singh 23101f87a1 move appstatesynckey to keys 2021-09-26 12:35:56 +05:30
Adhiraj Singh f267f27ada finalize multi-device 2021-09-22 22:19:53 +05:30
Adhiraj Singh 8a014df1c5 separate data structure for presence 2021-08-24 11:00:37 +05:30
Adhiraj Singh 71e34fc5f8 Cleanup + add remaining utils 2021-07-12 23:50:08 +05:30
Adhiraj Singh 89cf8004e9 Wrap up connection + in memory store 2021-07-09 20:35:07 +05:30
Adhiraj Singh 5be4a9cc2c remove all files 2021-07-07 23:20:11 +05:30