Remove the duplicate-hunt instrumentation, keep the audit line
The verbose per-send logging did its job: it proved this process sends each payout once, which is what pointed the search away from the deployed app and at a second server running elsewhere with the same bot token. Dropping the text dump. Keeping one line per send with the message_id Telegram assigns — that is the line that made the second sender findable, and a payment feed is worth being able to audit. Confirmed fixed: the payout at 17:47 posted exactly once to each feed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -216,13 +216,6 @@ function sendTelegramTo(chatId, text, topicId, replyMarkup, parseMode, dedupeKey
|
|||||||
console.warn('telegram duplicate suppressed:', dedupeKey, '->', String(chatId));
|
console.warn('telegram duplicate suppressed:', dedupeKey, '->', String(chatId));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TEMPORARY (2026-09-18): members are seeing payment lines twice. This process has a
|
|
||||||
// durable announce-once per on-chain event AND a send-level dedupe, and neither is firing,
|
|
||||||
// which means the second copy is not coming from here. Log every send with the instance id
|
|
||||||
// so "did WE send it twice, or is something else posting?" is answerable from the log
|
|
||||||
// instead of by deduction. Remove once the source is confirmed.
|
|
||||||
console.log('tg-send', TG_INSTANCE, 'chat=' + chatId, 'topic=' + (topicId || '-'),
|
|
||||||
JSON.stringify(String(text).replace(/\s+/g, ' ').slice(0, 70)));
|
|
||||||
// No link previews: payout/team-build posts carry Polygonscan links, and the
|
// No link previews: payout/team-build posts carry Polygonscan links, and the
|
||||||
// preview card tripled the height of every message in the group.
|
// preview card tripled the height of every message in the group.
|
||||||
const payload = { chat_id: chatId, text, disable_web_page_preview: true };
|
const payload = { chat_id: chatId, text, disable_web_page_preview: true };
|
||||||
@@ -236,9 +229,9 @@ function sendTelegramTo(chatId, text, topicId, replyMarkup, parseMode, dedupeKey
|
|||||||
}).then(async r=>{
|
}).then(async r=>{
|
||||||
const body = await r.json().catch(()=>null);
|
const body = await r.json().catch(()=>null);
|
||||||
if(!r.ok || !body || !body.ok) { console.error('telegram sendMessage status', r.status, JSON.stringify(body).slice(0,200)); return; }
|
if(!r.ok || !body || !body.ok) { console.error('telegram sendMessage status', r.status, JSON.stringify(body).slice(0,200)); return; }
|
||||||
// Log the id Telegram assigns. When a duplicate shows up in a feed, this says which of
|
// One concise line per send, kept deliberately: it is what identified a second sender
|
||||||
// the two copies is ours — and therefore whether this process sent twice or something
|
// posting into the same channel with the same bot token on 2026-09-18. A payment feed
|
||||||
// else with the same bot token posted the second one. (2026-09-18 duplicate hunt.)
|
// is worth being able to audit.
|
||||||
console.log('tg-ok', TG_INSTANCE, 'chat=' + chatId, 'message_id=' + (body.result && body.result.message_id));
|
console.log('tg-ok', TG_INSTANCE, 'chat=' + chatId, 'message_id=' + (body.result && body.result.message_id));
|
||||||
})
|
})
|
||||||
.catch(e=>console.error('telegram error', e.message));
|
.catch(e=>console.error('telegram error', e.message));
|
||||||
|
|||||||
Reference in New Issue
Block a user