fix: add .catch() handlers to fire-and-forget async calls#355
Merged
Conversation
Several async calls in the message loop and group queue are fire-and-forget without .catch() handlers. When WhatsApp disconnects or containers fail unexpectedly, these produce unhandled rejections that can crash the process. Add explicit .catch() at each call site so errors are logged with full context (groupJid, taskId) instead of crashing: - channel.setTyping() in message loop (adapted for channel abstraction) - startMessageLoop() in main() - runForGroup() and runTask() in group-queue (5 call sites) Closes #221 Co-Authored-By: Naveen Jain <1779929+naveenspark@users.noreply.github.com> Co-Authored-By: Skip Potter <skip.potter.va@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c5596ea to
f8e77b3
Compare
tunmaker
pushed a commit
to tunmaker/nanoclaw
that referenced
this pull request
Feb 24, 2026
…) (qwibitai#355) Several async calls in the message loop and group queue are fire-and-forget without .catch() handlers. When WhatsApp disconnects or containers fail unexpectedly, these produce unhandled rejections that can crash the process. Add explicit .catch() at each call site so errors are logged with full context (groupJid, taskId) instead of crashing: - channel.setTyping() in message loop (adapted for channel abstraction) - startMessageLoop() in main() - runForGroup() and runTask() in group-queue (5 call sites) Closes qwibitai#221 Co-authored-by: Naveen Jain <1779929+naveenspark@users.noreply.github.com> Co-authored-by: Skip Potter <skip.potter.va@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
vedtam
pushed a commit
to vedtam/nanoclaw
that referenced
this pull request
Feb 26, 2026
…) (qwibitai#355) Several async calls in the message loop and group queue are fire-and-forget without .catch() handlers. When WhatsApp disconnects or containers fail unexpectedly, these produce unhandled rejections that can crash the process. Add explicit .catch() at each call site so errors are logged with full context (groupJid, taskId) instead of crashing: - channel.setTyping() in message loop (adapted for channel abstraction) - startMessageLoop() in main() - runForGroup() and runTask() in group-queue (5 call sites) Closes qwibitai#221 Co-authored-by: Naveen Jain <1779929+naveenspark@users.noreply.github.com> Co-authored-by: Skip Potter <skip.potter.va@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
bagelagent
pushed a commit
to bagelagent/nanoclaw
that referenced
this pull request
Mar 3, 2026
…) (qwibitai#355) Several async calls in the message loop and group queue are fire-and-forget without .catch() handlers. When WhatsApp disconnects or containers fail unexpectedly, these produce unhandled rejections that can crash the process. Add explicit .catch() at each call site so errors are logged with full context (groupJid, taskId) instead of crashing: - channel.setTyping() in message loop (adapted for channel abstraction) - startMessageLoop() in main() - runForGroup() and runTask() in group-queue (5 call sites) Closes qwibitai#221 Co-authored-by: Naveen Jain <1779929+naveenspark@users.noreply.github.com> Co-authored-by: Skip Potter <skip.potter.va@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 5, 2026
jenskock
pushed a commit
to jenskock/nanoclaw
that referenced
this pull request
Mar 6, 2026
…) (qwibitai#355) Several async calls in the message loop and group queue are fire-and-forget without .catch() handlers. When WhatsApp disconnects or containers fail unexpectedly, these produce unhandled rejections that can crash the process. Add explicit .catch() at each call site so errors are logged with full context (groupJid, taskId) instead of crashing: - channel.setTyping() in message loop (adapted for channel abstraction) - startMessageLoop() in main() - runForGroup() and runTask() in group-queue (5 call sites) Closes qwibitai#221 Co-authored-by: Naveen Jain <1779929+naveenspark@users.noreply.github.com> Co-authored-by: Skip Potter <skip.potter.va@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
bebekim
pushed a commit
to bebekim/goodclaw
that referenced
this pull request
Mar 14, 2026
…) (qwibitai#355) Several async calls in the message loop and group queue are fire-and-forget without .catch() handlers. When WhatsApp disconnects or containers fail unexpectedly, these produce unhandled rejections that can crash the process. Add explicit .catch() at each call site so errors are logged with full context (groupJid, taskId) instead of crashing: - channel.setTyping() in message loop (adapted for channel abstraction) - startMessageLoop() in main() - runForGroup() and runTask() in group-queue (5 call sites) Closes qwibitai#221 Co-authored-by: Naveen Jain <1779929+naveenspark@users.noreply.github.com> Co-authored-by: Skip Potter <skip.potter.va@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
squarewings
pushed a commit
to squarewings/nanoclaw
that referenced
this pull request
Mar 15, 2026
…) (qwibitai#355) Several async calls in the message loop and group queue are fire-and-forget without .catch() handlers. When WhatsApp disconnects or containers fail unexpectedly, these produce unhandled rejections that can crash the process. Add explicit .catch() at each call site so errors are logged with full context (groupJid, taskId) instead of crashing: - channel.setTyping() in message loop (adapted for channel abstraction) - startMessageLoop() in main() - runForGroup() and runTask() in group-queue (5 call sites) Closes qwibitai#221 Co-authored-by: Naveen Jain <1779929+naveenspark@users.noreply.github.com> Co-authored-by: Skip Potter <skip.potter.va@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
onlyforart
referenced
this pull request
in onlyforart/nanoclaw
Mar 27, 2026
Several async calls in the message loop and group queue are fire-and-forget without .catch() handlers. When WhatsApp disconnects or containers fail unexpectedly, these produce unhandled rejections that can crash the process. Add explicit .catch() at each call site so errors are logged with full context (groupJid, taskId) instead of crashing: - channel.setTyping() in message loop (adapted for channel abstraction) - startMessageLoop() in main() - runForGroup() and runTask() in group-queue (5 call sites) Closes #221 Co-authored-by: Naveen Jain <1779929+naveenspark@users.noreply.github.com> Co-authored-by: Skip Potter <skip.potter.va@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
dm-j
pushed a commit
to dm-j/nanoclaw
that referenced
this pull request
Apr 13, 2026
…) (qwibitai#355) Several async calls in the message loop and group queue are fire-and-forget without .catch() handlers. When WhatsApp disconnects or containers fail unexpectedly, these produce unhandled rejections that can crash the process. Add explicit .catch() at each call site so errors are logged with full context (groupJid, taskId) instead of crashing: - channel.setTyping() in message loop (adapted for channel abstraction) - startMessageLoop() in main() - runForGroup() and runTask() in group-queue (5 call sites) Closes qwibitai#221 Co-authored-by: Naveen Jain <1779929+naveenspark@users.noreply.github.com> Co-authored-by: Skip Potter <skip.potter.va@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.catch()handlers to 7 fire-and-forget async calls that can produce unhandled promise rejections and crash the processwhatsapp.setTyping()→channel.setTyping?.()Closes #221
Supersedes #242, #243
Changes
src/group-queue.ts.catch()on 5 fire-and-forgetrunForGroup()/runTask()calls with contextual logging (groupJid, taskId)src/index.ts.catch()onchannel.setTyping?.()(adapted for channel abstraction with optional chaining),.catch()onstartMessageLoop()with fatal log + exitTest plan
npx tsc --noEmit— cleannpx vitest run— 305/306 pass (1 pre-existing failure in voice note test, unrelated)🤖 Generated with Claude Code