zebra-report: exponential retransmit backoff (stop hammering on lost ACK)

This commit is contained in:
russell@unturf.com 2026-05-28 12:44:21 -04:00
parent abde9079c8
commit 1183e17ba3
No known key found for this signature in database

View file

@ -1010,7 +1010,8 @@ function renderOutbox() {
function scheduleRetransmit(crc) {
const entry = msgPending.get(crc);
if (!entry) return;
const wait = estimateTxMs(entry.frame.length) + estimateTxMs(15) + 4000; /* data + ack + margin */
const base = estimateTxMs(entry.frame.length) + estimateTxMs(15) + 4000; /* data + ack + margin */
const wait = base * Math.pow(1.8, entry.tries - 1); /* exponential backoff — don't hammer */
entry.timer = setTimeout(async () => {
const e = msgPending.get(crc);
if (!e) return; /* already ACKed */