picoclaw/pkg/channels/whatsapp_native
Hoshina c7d75a18f8 fix(whatsapp_native): fix goroutine and resource leak in Start/Stop lifecycle
- Move runCtx/runCancel creation before event handler registration and
  QR loop so Stop() can cancel at any point during startup
- Replace blocking QR event loop in Start() with a background goroutine
  that selects on runCtx.Done(), preventing Start() from hanging
  indefinitely when waiting for QR scan
- Track all background goroutines (QR handler, reconnect) with
  sync.WaitGroup; Stop() waits for them to finish before releasing
  client/container resources
- Cancel runCtx on error paths in Start() to avoid leaked contexts

Fixes resource leak introduced in #655.
2026-02-28 01:39:06 +08:00
..
init.go Complete the whatsapp native channel implementation based on the new channel interface 2026-02-26 22:35:52 -08:00
whatsapp_native.go fix(whatsapp_native): fix goroutine and resource leak in Start/Stop lifecycle 2026-02-28 01:39:06 +08:00
whatsapp_native_stub.go chore: fix go fmt formatting issues after rebase 2026-02-27 17:35:50 +08:00