Commit Graph

135 Commits

Author SHA1 Message Date
Rajeh Taher a2e7e070fc general: remove console logs, linting 2025-09-08 23:11:32 +03:00
Rajeh Taher 5b6eae4523 socket: fix error 2025-09-08 23:01:02 +03:00
Rajeh Taher 20693a59d0 lid, wip: Support LIDs in Baileys (#1747)
* lid-mapping: get missing lid from usync

* lid-mapping, jid-utils: change to isPnUser and store multiple mappings

* process-message: parse protocolMsg mapping, and store from new msgs

* types: lid-mapping event, addressing enum, alt, contact, group types

* validate, decode: use lid for identity, better logic

* lid: final commit

* linting

* linting

* linting

* linting

* misc: fix testing and also remove version json

* lint: IDE fucking up lint

* lid-mapping: fix build error on NPM

* message-retry: fix proto import
2025-09-08 10:03:28 +03:00
Rajeh Taher 2a00d65e44 cleaning up after AI slop! 2025-09-07 20:34:19 +03:00
Paulo Victor Lund f83a1c2aff Add mutex-based transaction safety to Signal key store (re-reworked) (#1697)
* mutex reimplementation

* lint

* lint

* lint fix

* Add cleanup for expired sender key mutexes

Introduces a mechanism to periodically clean up unused sender key mutexes in addTransactionCapability, reducing memory usage by removing mutexes that have not been used for over an hour and are not locked. A timer is started when the first mutex is created, and cleanup runs every 30 minutes.

* Update auth-utils.ts

* Refactor Signal key transaction usage

Introduces a local variable for parsed Signal keys in libsignal.ts to avoid repeated type assertions and improve code clarity.

* Refactor transaction handling for key operations

Introduces per-entity mutexes and passes key identifiers to transaction calls for finer-grained concurrency control in Signal key storage and socket operations. Updates transaction signatures and usage across Signal, Socket, and Utils modules to improve atomicity and performance, especially for system and sync messages.

* Improve SignalKeyStore transaction handling

Refactored transaction logic in SignalKeyStore to add commit retries, cleanup of transaction state, and improved mutex management for sender keys. Enhanced validation and batching for pre-key deletions and updates, improving concurrency and reliability.

* Replace custom mutex cleanup with LRU cache

Switched from manual mutex cleanup logic to using the lru-cache package for managing mutexes in addTransactionCapability. This simplifies resource management and ensures expired mutexes are automatically purged. Added lru-cache as a dependency.

* Lint fix

* Update src/Signal/libsignal.ts

* Update libsignal.ts

---------

Co-authored-by: João Lucas <jlucaso@hotmail.com>
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2025-09-07 20:22:47 +03:00
Gustavo Quadri 0043f8be21 Add: LID support with lid-map and migrations of sessions (#1694)
* fix: add lid-map logic

* fix: lint and simplified version

* fix: single device migration

* fix: lid map discovery

* fix: lint

* fix: lid migration in socket connection

* fix: lint

* fix: decode-wa-message consistency

* fix: yarn lock

* fix: lint

* fix: retry logic

* fix: logger level
2025-09-07 14:12:24 +03:00
Gustavo Quadri 8f21a67e4a fix: sync pre-keys on socket start and add specific pre-key error approach (#1663)
* fix: sync prekeys when storage mismatch

* fix: verify if current pre-key exists instead of matching

* add: pre-keys error specific approach

* fix: lint

* fix: lint
2025-09-07 14:11:50 +03:00
João Lucas de Oliveira Lopes 0fbce52fd3 fix(socket): Prevent crashes from timeouts and fix memory leak (#1627) 2025-09-07 14:11:32 +03:00
João Lucas de Oliveira Lopes 4d4339dae6 feat(WAProto): Optimize protobuf generation for 80%+ bundle size reduction (#1665)
* chore: remove comments and veirfy from generated proto files (improve size)

* refactor: replace fromObject with create for proto message instantiation and flag no beautiful

* chore: lint issues
2025-09-07 14:08:11 +03:00
Rajeh Taher 8dc852ee89 proto: fix proto generation, tsc: fix node imports of compiled code 2025-07-19 23:16:35 +03:00
Rajeh Taher 90781ce0f2 eslint: upgrade to version 9 + tests: remove tests 2025-07-18 22:30:50 +03:00
Rajeh Taher 787aed88b8 project: Move to ESM Modules 2025-07-17 13:54:17 +03:00
Cassio Santos 4ccec1f6ce fix: do not throw error on socket closed while opening (#1576) 2025-07-04 17:31:46 -03:00
DevAstro 60577cf8d3 allow custom pairing code (#1550) 2025-06-25 09:05:12 -03:00
canove fa706d0b50 chore: format everything 2025-05-06 12:10:19 -03:00
canove 6d4ce2cb18 chore: avoid unhandled promise timeout errors 2025-04-24 13:38:43 -03:00
canove 2dbfb085d5 chore: avoid unhandled promise timeout errors 2025-04-24 13:38:00 -03:00
canove 2382fb8723 chore: avoid unhandled promise timeout errors 2025-04-24 13:37:03 -03:00
João Lucas de Oliveira Lopes c2cf49cd68 refactor: remove unused dependencies and clean up type exports (#1319) 2025-04-09 02:51:33 +03:00
Rajeh Taher a29138758c socket, binary, usync: fix linting 2025-03-14 23:38:53 +02:00
Rajeh Taher 1c2af09b03 socket,config: deprecate printQRInTerminal option
This was done to reduce dependencies
2025-03-10 15:08:50 +02:00
João Lucas de Oliveira Lopes 8083754621 refactor: turn hkdf functions to async and remove extra deps (#1272)
* refactor: remove futoin-hkdf dependency and update hkdf implementation

* refactor: use crypto subtle and update functions to async

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2025-03-01 18:31:48 +02:00
Rajeh Taher 447e648958 --no-edit 2025-03-01 18:30:09 +02:00
Rajeh Taher 3fca643d92 messaging: fix the hangs caused by the 66e error 2025-01-30 23:31:25 +02:00
Rajeh Taher 18ac07df8e lint: 0 warnings left 2024-10-14 05:15:10 +03:00
Rajeh Taher 61a0ff3178 mobile: deprecation. 2024-10-14 03:56:32 +03:00
vini dbf25771a1 refactor: Change Sync Functions to Promises to Prevent Blocking Event Loop (#896)
* initial commit

* lint

* lint 2
2024-07-03 10:29:16 +03:00
Bob 13be112b18 Feat: others browsers in requestPairingCode() (#879)
* update

* l

* string

* added Safari

* Update getPlatformId

* Update getPlatformId (fix)
2024-06-30 06:10:50 +03:00
Rajeh Taher d7037cf6fa fix(fix-routing-info): initial commit (#837) 2024-06-03 00:59:09 +03:00
Rajeh Taher 0eaa5af909 feat(add-routing-info): initial commit (#773) 2024-05-15 18:34:37 +03:00
Javier Cuevas 8c61f6719f Fix typo: onMessageRecieved -> onMessageReceived (#652)
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2024-04-28 14:08:10 +03:00
Javier Cuevas bb9cc01069 Fix logging of send/recv xml nodes with pino (#653) 2024-04-28 14:05:40 +03:00
Rajeh Taher 306e1c1355 WEB WAM IMPLEMENTATION!!!!! (#708)
* feat(WAM): initial commit

* fix(wam-development): I made a whoopsie

* Update Example/example.ts

Co-authored-by: Javier Cuevas <javiercr@gmail.com>

---------

Co-authored-by: Javier Cuevas <javiercr@gmail.com>
2024-04-28 14:03:24 +03:00
ShellTear a60cdfb053 Merge pull request #563 from kyraex/retain-creds
Retain existing authState.creds.me properties and add lid
2024-01-03 00:13:21 +02:00
Rajeh Taher abe42564be fix: fix pairing code 2024-01-02 03:55:20 +02:00
Ahmad Syauqi 9df3d2410a Retain existing authState.creds.me properties when updating lid during creds update event 2023-12-28 15:47:45 +08:00
Rajeh Taher 6546793ec6 fixes 2023-10-01 14:16:29 +00:00
Rajeh Taher 0b2f4d0b42 Update socket.ts 2023-10-01 16:55:40 +03:00
Rajeh Taher f50842fd7a Socket-passthrough 2023-09-28 03:08:50 +03:00
Alessandro Autiero a7e39c18d9 Fixed infinite reconnection cycle 2023-07-16 21:20:21 +02:00
Alessandro Autiero c506182035 Finished requestPairingCode 2023-07-16 20:14:17 +02:00
Alessandro Autiero f498e1e56c Added requestPairingCode method and handler
Fixed typo (trimUndefineds)
Added bytesToCrockford
Replaced advSecretKey with advKeyPair
Added pairingCode prop
Fixed formatting
Added pairing code example
2023-07-16 18:44:17 +02:00
Edgard Lorraine Messias 54f8215eef fix: Re-added the option to use proxy agent forn non-mobile api (#148) 2023-06-15 21:46:43 -03:00
SamuelScheit 90fe440f9a chore: remove console.logs 2023-05-19 10:15:40 +02:00
SamuelScheit 6ecc5a8757 fix: socket options 2023-05-12 18:02:41 +02:00
SamuelScheit 470e19d3fc auto connect socket 2023-04-30 12:33:20 +02:00
SamuelScheit 65aa4a7d99 unify web + mobile and use tcp socket 2023-04-30 12:30:30 +02:00
SamuelScheit ef673f62ca feat: native-mobile-api 2023-04-20 13:01:11 +02:00
Adhiraj Singh fe1d0649b5 feat: add signal repository + tests 2023-03-18 12:25:47 +05:30
Adhiraj Singh f013b61e35 chore: update axios 2023-02-18 12:34:04 +05:30