Extension: surface a disconnected-tablet warning instead of silent success
A push can succeed server-side (session created) with nowhere to actually deliver to — the backend's pushNavigate() already distinguishes this via a delivered:false return (see device-stream.js), but nothing in the extension read it: every surface just said "Sent" regardless. Confirmed live on the dev stack 2026-10-01 — the registered dev tablet hadn't heartbeated in a month, so a push looked successful but nothing happened. Now every send path (injected buttons' fast path + manual picker, popup's fast path + manual picker) shows an amber "tablet isn't connected right now" warning when delivered is false. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
db6ffb7aa4
commit
4aeca15281
3 changed files with 28 additions and 7 deletions
|
|
@ -131,8 +131,13 @@ async function handleSendClick(anchorBtn, bookingId, guestName, variant) {
|
|||
return;
|
||||
}
|
||||
if (result?.ok) {
|
||||
status.textContent = 'Sent — the tablet should navigate now.';
|
||||
status.style.color = '#166534';
|
||||
if (result.delivered === false) {
|
||||
status.textContent = 'Sent, but that tablet isn’t connected right now — it’ll pick this up if it reconnects.';
|
||||
status.style.color = '#b45309';
|
||||
} else {
|
||||
status.textContent = 'Sent — the tablet should navigate now.';
|
||||
status.style.color = '#166534';
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (result?.status === 409) {
|
||||
|
|
@ -256,7 +261,10 @@ async function togglePanel(anchorBtn, bookingId, guestName, variant = 'block', n
|
|||
action: 'tcpPush', bookingId, deviceId: select.value,
|
||||
});
|
||||
if (result?.ok) {
|
||||
panel.textContent = 'Sent — the tablet should navigate now.';
|
||||
panel.textContent = result.delivered === false
|
||||
? 'Sent, but that tablet isn’t connected right now — it’ll pick this up if it reconnects.'
|
||||
: 'Sent — the tablet should navigate now.';
|
||||
panel.style.color = result.delivered === false ? '#b45309' : '#1e293b';
|
||||
} else {
|
||||
panel.textContent = `Failed: ${result?.error || 'unknown error'}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue