Commit Graph

24 Commits

Author SHA1 Message Date
Marcus Castro f705f69fc2 fix(whatsapp): preserve live connections across reloads (#110762) 2026-07-18 14:18:11 -03:00
Wynne668 bcc44ba1b1 fix(whatsapp): resolve abortPromise when stop signal already fired (#109903)
* fix(whatsapp): resolve abortPromise when stop signal already fired

waitForClose() races on abortPromise, but a pre-aborted gateway stop
signal never settled that promise because the abort listener was skipped.
Resolve abortPromise immediately when abortSignal.aborted is already true.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(whatsapp): resolve tsgo TS18048 and test mock in pre-aborted abortPromise fix

- Extract params.abortSignal to local const so tsgo can narrow the type
  through else-if control flow, fixing TS18048: possibly undefined
- Remove setupAbortController/ownerAcquireAbortController.abort() from
  the constructor's pre-aborted branch so openConnection() still works
  when the stop signal was already fired at construction time
- Use createSocketWithTransportEmitter() mock in the new test so
  shutdown() cleanup has sock.end() and ws.removeListener() available

* fix(whatsapp): preserve pre-aborted setup cancellation

* fix(whatsapp): unify connection abort handling

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-18 02:04:59 +01:00
Peter Steinberger bf413374cc fix(whatsapp): add live group directory (#109886)
* fix(whatsapp): serve live group directory safely

Co-authored-by: xialonglee <li.xialong@xydigit.com>

* fix(whatsapp): complete owner lock retry policy

* test(whatsapp): match socket end signature

* fix(whatsapp): preserve live lookup cleanup errors

* refactor(whatsapp): keep owner error code internal

---------

Co-authored-by: xialonglee <li.xialong@xydigit.com>
2026-07-17 11:12:07 +01:00
Peter Steinberger 9ea4b167fa refactor(deadcode): trim channel auth exports (#106247) 2026-07-13 02:45:34 -07:00
Marcus Castro 80d11f1246 refactor(whatsapp): use runtime context for connection controllers (#104949)
* refactor(whatsapp): replace connection controller registry

* fix(whatsapp): remove controller context import cycle
2026-07-12 14:22:57 -03:00
Peter Steinberger 96f0983a85 fix(onboarding): skip setup for configured gateways and require inference first (#102883)
* fix(crestodian): keep onboarding RPCs restart-safe

* fix(profiles): isolate approval state migrations

* fix(crestodian): bypass configured gateway setup

* test(crestodian): type onboarding mocks

* fix(onboarding): require inference before Crestodian

* fix(onboarding): enforce verified inference handoff

* fix(macos): reset setup on gateway endpoint edits

* chore(i18n): refresh native source inventory

* fix(gateway): keep socket on request cancellation

* test(packaging): require workspace templates

* fix(onboarding): bind setup to verified inference

* fix(onboarding): align inference gate contracts

* fix(crestodian): classify concurrent policy rejection

* test(crestodian): expect registry restoration

* fix(onboarding): bind setup to configured gateways

* fix(codex): preserve startup phase deadlines

* test(crestodian): match fail-closed policy ordering

* test(onboarding): assert bound gateway handoff

* fix(codex): bind runtime resolution to spawn cwd

* test(crestodian): assert policy rejection order

* fix(cli): preserve gateway routing across restarts

* fix(macos): fail closed during gateway edits

* test(macos): cover gateway route generation races

* chore: keep release notes out of onboarding PR

* fix(ci): refresh onboarding generated checks

* style(swift): align gateway channel formatting

* fix(ci): refresh plugin SDK surface budgets

* fix(ci): resync native string inventory

* refactor(swift): split gateway channel support

* test(doctor): isolate plugin compatibility registry

* test(macos): isolate gateway onboarding fixtures

* test(macos): assert gateway lease health ordering

* fix(codex): reconcile computer-use startup changes
2026-07-11 10:25:14 -07:00
Vincent Koc 89eb493d1d fix(whatsapp): remove dead watchdog timeout clamp (#95706)
Merged via squash.

Prepared head SHA: 0b17b1f051
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
2026-06-22 17:47:10 +08:00
Marcus Castro 52d9d16e1b fix(whatsapp): preserve auth on terminal disconnects (#93076)
* fix(whatsapp): preserve auth on passive terminal stops

* fix(whatsapp): recover stale web auth during relink

* fix(gateway): defer channel stop until qr takeover
2026-06-15 20:50:22 -03:00
zhang-guiping 8afbc98018 fix(whatsapp): require durable auth before login success (#92095) 2026-06-14 10:24:14 +08:00
Marcus Castro 008d785a80 test(whatsapp): update auto reply inbound fixtures 2026-06-11 17:29:24 +01:00
Peter Steinberger 58912f8fd8 docs: document channel extension sources 2026-06-04 21:59:00 -04:00
Marcus Castro dd2083c7ec fix(whastapp): bound connection startup waits (#90486)
* fix: add timeout to waitForWaConnection to prevent indefinite hangs

If Baileys fails to emit a 'connection.update' event with either 'open'
or 'close' status (e.g. due to network issues or internal errors), the
waitForWaConnection promise hangs forever, blocking the entire monitor
loop.

Add a configurable timeout (default 60s) that rejects the promise and
cleans up the event listener if no connection state is received in time.
The timeout is backward-compatible as an optional parameter with a
sensible default.

* test: add coverage for waitForWaConnection timeout path

- Test that promise rejects with descriptive error after timeout
- Test that event listener is cleaned up after timeout
- Test that timer is cleared when connection opens before timeout

* fix: default timeoutMs to 0 to preserve QR login behavior

The 60s default broke the QR login flow in login-qr.ts, which calls
waitForWaConnection without a timeout and expects to wait up to 3 minutes
while the user scans. Change the default to 0 (wait forever, matching
original behavior) and pass the 60s timeout explicitly at the monitor
callsite where it's actually needed.

* fix: bound whatsapp connection startup waits

* fix: align web channel wait contract

* fix: retry whatsapp setup timeouts

* fix: satisfy whatsapp status lint

* fix: preserve whatsapp wait compatibility

---------

Co-authored-by: MMMMSSSS8899 <praelovk@gmail.com>
2026-06-04 21:45:43 -03:00
Peter Steinberger 304e2c83c0 chore(lint): enable stricter oxlint rules 2026-05-31 18:59:02 +01:00
Marcus Castro f613f32b22 fix(whatsapp): retry QR login 408 timeouts (#88183) 2026-05-30 00:59:12 -03:00
Peter Steinberger 7899b70c18 test: dedupe whatsapp close mock read 2026-05-13 07:21:41 +01:00
Peter Steinberger b42227e476 test: guard whatsapp mock calls 2026-05-12 10:19:51 +01:00
Peter Steinberger c04df3adfb test: tighten whatsapp connection close assertion 2026-05-09 05:05:04 +01:00
Peter Steinberger 05eda57b3c refactor: migrate bundled plugins to message lifecycle 2026-05-06 01:46:42 +01:00
Peter Steinberger 6922500382 fix: end WhatsApp sockets during teardown 2026-05-02 02:29:14 +01:00
Peter Steinberger eab4024934 fix(whatsapp): track provider-accepted auto-replies 2026-04-30 03:38:19 +01:00
Sathvik Gilakamsetty 7ddd815e46 fix(whatsapp): report transport activity so stale-socket health detection works (#72656)
Merged via squash.

Prepared head SHA: 1b1920742c
Co-authored-by: Sathvik-1007 <195685832+Sathvik-1007@users.noreply.github.com>
Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com>
Reviewed-by: @mcaxtr
2026-04-29 00:46:55 -03:00
Marcus Castro aa76cf43f0 fix(whatsapp): stabilize auth state and reconcile local runtime after CLI login (#67815)
* WhatsApp: harden auth persistence and backup recovery

* WhatsApp: model unstable auth state across runtime and setup

* WhatsApp: recover login and monitor startup from unstable auth

* Channels: surface auth stabilizing in status and health

* Gateway protocol: add channels.start surface

* Gateway: reconcile local channel runtime after CLI login

* Channels UI: reflect recovered login start state

* Changelog: note WhatsApp auth stabilization

* Gateway: fix lint in call test
2026-04-19 14:20:46 -03:00
Neerav Makwana 405c63fb32 fix: flush creds queue before reconnect socket open (#67464) (thanks @neeravmakwana)
* WhatsApp: flush creds queue before reconnect socket open

* fix: flush creds queue before reconnect socket open (#67464) (thanks @neeravmakwana)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-16 10:16:00 +05:30
Marcus Castro aa023e4283 refactor(whatsapp): centralize account connection lifecycle (#65427)
* refactor(whatsapp): centralize account connection lifecycle

* fix(whatsapp): harden controller open failure cleanup

* refactor(whatsapp): remove active listener fallback path

* fix(whatsapp): isolate controller registry state

* debug(whatsapp): trace typing presence updates

* docs(changelog): add whatsapp lifecycle fix note

* debug(whatsapp): log global presence mode

* chore(whatsapp): remove debug presence logs

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-12 15:24:49 -03:00