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
This commit is contained in:
Marcus Castro
2026-04-19 14:20:46 -03:00
committed by GitHub
parent 1d4e4314dd
commit aa76cf43f0
53 changed files with 2191 additions and 366 deletions

View File

@@ -41,16 +41,17 @@ export async function startWhatsAppLogin(state: ChannelsState, force: boolean) {
}
state.whatsappBusy = true;
try {
const res = await state.client.request<{ message?: string; qrDataUrl?: string }>(
"web.login.start",
{
force,
timeoutMs: 30000,
},
);
const res = await state.client.request<{
message?: string;
qrDataUrl?: string;
connected?: boolean;
}>("web.login.start", {
force,
timeoutMs: 30000,
});
state.whatsappLoginMessage = res.message ?? null;
state.whatsappLoginQrDataUrl = res.qrDataUrl ?? null;
state.whatsappLoginConnected = null;
state.whatsappLoginConnected = typeof res.connected === "boolean" ? res.connected : null;
} catch (err) {
state.whatsappLoginMessage = String(err);
state.whatsappLoginQrDataUrl = null;