Code AnalysisHard 60s
Idempotency: naive dedupe key
async function handle(msg) {
if (await seen.has(msg.id)) return; // check
await process(msg);
await seen.add(msg.id); // then mark
}
// Concurrent duplicate deliveries both pass the check.
What is the flaw and fix?
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.