Doctor: avoid re-adding WhatsApp config#927
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 669a39d57f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/commands/doctor-legacy-config.ts
Outdated
| const legacyAckReaction = cfg.messages?.ackReaction?.trim(); | ||
| if (legacyAckReaction) { | ||
| const hasWhatsAppConfig = cfg.channels?.whatsapp !== undefined; | ||
| if (legacyAckReaction && hasWhatsAppConfig) { |
There was a problem hiding this comment.
Keep migrating ackReaction for default WhatsApp configs
This new guard skips the migration whenever channels.whatsapp is absent, but WhatsApp can still be active with no config section (e.g., listWhatsAppAccountIds falls back to the default account and resolveWhatsAppAccount only reads cfg.channels?.whatsapp for ackReaction). For users who only set messages.ackReaction and rely on default WhatsApp config, running doctor will no longer copy that setting into channels.whatsapp.ackReaction, so WhatsApp acks silently stop. If the goal is to avoid re-adding for non‑WhatsApp users, consider checking for actual WhatsApp usage (auth/account presence) rather than the config section’s existence.
Useful? React with 👍 / 👎.
Thanks @grp06. Co-authored-by: George Pickett <gpickett00@gmail.com>
|
Landed via squash+rebase onto main.
Commit: 1078d17 Thanks @grp06! |
Thanks @grp06. Co-authored-by: George Pickett <gpickett00@gmail.com>
Summary
Testing
AI Assistance