Commit Graph

20 Commits

Author SHA1 Message Date
Claude 48b63565b6 fix: revert ?? '' and defensive null checks across Socket files
PRs 124-129 replaced TypeScript non-null assertions (!) with optional
chaining (?.) and empty string defaults (?? ''). While defensive
programming is usually good, in Signal protocol and WhatsApp binary
node handling code these changes caused:

- Malformed JIDs with empty user components (e.g. @s.whatsapp.net)
- Silent device enumeration failures (messages skip recipients)
- Wrong own-device detection (message routing errors)
- Broken prekey count handling (prekey uploads silently skipped)
- Wrong retry count tracking in Signal protocol

These empty-string defaults are dangerous because Signal session
lookups fail for malformed JIDs, causing "SessionError: No sessions".

Reverted to original Baileys pattern using non-null assertions (!)
which match the upstream reference (infinitezap/Teste_InfiniteAPI).

Files fixed: messages-send.ts, messages-recv.ts, socket.ts, chats.ts,
groups.ts, communities.ts, business.ts

https://claude.ai/code/session_01XaA7GwNaB6azTHFYQ8WEpB
2026-02-09 10:10:56 +00:00
Claude 1c9fb86cc3 fix(types): remove non-null assertions in remaining 12 files
Files fixed:
- messages-media.ts: stream/buffer guards, file path validation
- decode-wa-message.ts: message field guards, optional chaining
- version-cache.ts: narrowing after null checks
- jid-utils.ts: split result guards, user fallbacks
- communities.ts: attrs fallbacks with ?? operator
- sticker-pack.ts: response guards
- business.ts: attrs guards
- socket.ts: onClose guard, pairingCode guard, creds.me guard
- event-buffer.ts: null guards
- signal.ts: null guards
- encode.ts (WAM): id null check with continue
- upstream history.ts: conversations/pushnames null guards

All 26 files across the project are now corrected.
Total: ~248 non-null assertions replaced with proper null guards.

https://claude.ai/code/session_01E2cfX1N3sJgCJBTvzGazSG
2026-02-09 00:32:04 +00:00
Rajeh Taher b1c76ebe2d chore: lint+bugfix 2026-01-18 01:31:56 +02:00
Ibrahim Pelumi Lasisi 720cc688d6 fix: avoid variable shadowing and preserve empty business profile fields (#2183)
* Update business.ts

* chore: fix lint issues
2026-01-08 21:56:13 +02:00
vini 50fc83b008 feat(business): change profile/cover photo and manage quick replies (#1724) 2025-09-07 14:08:26 +03:00
Rajeh Taher 787aed88b8 project: Move to ESM Modules 2025-07-17 13:54:17 +03:00
canove fa706d0b50 chore: format everything 2025-05-06 12:10:19 -03:00
Rajeh Taher 7d80bf0ea2 feat(add-logger): initial commit (#777) 2024-05-15 18:36:20 +03:00
Rajeh Taher ce325d1182 fix(master): linting warnings 2024-05-10 16:33:59 +03:00
Adhiraj Singh fe1d0649b5 feat: add signal repository + tests 2023-03-18 12:25:47 +05:30
Adhiraj Singh bed4f7f524 chore: add GetCatalogOptions type
!BREAKING_CHANGE
2022-12-08 13:32:10 +05:30
Adhiraj Singh c96a7652d9 feat: add nextPageCursor 2022-12-08 13:30:31 +05:30
Adhiraj Singh ebd92e0337 fix: correctly fire product edit 2022-08-18 15:51:49 +05:30
Adhiraj Singh 3131f2aa35 fix: correctly create product 2022-08-18 15:46:25 +05:30
Adhiraj Singh 40a1e268aa feat: add "strictNullChecks" 2022-07-09 10:20:07 +05:30
Adhiraj Singh 0995b1231a fix: use string values in business catalog 2022-04-01 21:17:46 +05:30
Adhiraj Singh 8a9de2f042 fix: fetch order details on MD 2022-03-14 19:49:41 +05:30
Adhiraj Singh 238cde23b7 feat: automatic upload detection for product images 2022-03-07 15:33:52 +05:30
Adhiraj Singh 6967e53164 feat: implement product CRUD on MD 2022-03-07 09:09:08 +05:30
Adhiraj Singh c4edcef5da feat: implement fetching product catalog + order details on MD 2022-03-06 13:30:11 +05:30