fix(miniflare): local email reply rejects the permitted 100th References entry
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nodejs, typescript
- Ambito
- testing-qa, tooling
Direzione di ricerca
Inizia da packages/miniflare/src/workers/email/validate.ts (il controllo di replyability intorno alle righe 36-49), dove il numero di references viene confrontato con il limite; il confine è sfasato di uno, quindi un conteggio di esattamente 100 viene rifiutato. Leggi la funzione di supporto alla validazione che lo circonda e i test unitari esistenti accanto a essa in packages/miniflare/src/workers/email/ prima di modificare. Il lavoro è completato quando 99 e 100 references rispondono con successo, 101 continua a fallire con il messaggio del limite di References e viene aggiunto un test di confine a 100 nella suite. Lo script di riproduzione nell'issue è una buona conferma end-to-end una volta che il test unitario passa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
wrangler dev --local rejects a structured message.reply() when the incoming message contains exactly 100 valid References entries. The documented Email Routing limit allows 100 and rejects incoming messages with more than 100 entries.
Steps to reproduce
- With Node.js and npm available and port 28676 free, save the script as
reproduce.shand runsh reproduce.sh. - The script installs the listed Wrangler version into a temporary directory, starts a Worker with the documented local routing flow, and posts three RFC 5322 fixtures with 99, 100, and 101 unique
Referencesentries. Each fixture has anIn-Reply-Tomatching the last reference and a unique currentMessage-ID. The Worker tries one structured reply per inbound event. - Compare the HTTP status and recorded reply count. The script exits zero when it observes the current off-by-one result and both adjacent controls behave as observed.
Reproduction script: reproduce.sh
#!/bin/sh
set -eu
test_dir=$(mktemp -d)
worker_pid=
cleanup() {
if [ -n "$worker_pid" ]; then
kill "$worker_pid" 2>/dev/null || true
wait "$worker_pid" 2>/dev/null || true
fi
rm -rf "$test_dir"
}
trap cleanup EXIT
cd "$test_dir"
npm install --no-audit --no-fund --no-save [email protected]
cat > wrangler.json <<'CONFIG'
{
"name": "email-references-limit",
"main": "worker.js",
"compatibility_date": "2026-11-21",
"send_metrics": false
}
CONFIG
cat > worker.js <<'WORKER'
export default {
async email(message) {
await message.reply({
from: message.to,
subject: "Re: References boundary",
text: "Reply fixture",
});
},
};
WORKER
server=http://127.0.0.1:28676
./node_modules/.bin/wrangler dev --local --ip 127.0.0.1 --port 28676 > wrangler.log 2>&1 &
worker_pid=$!
for attempt in $(seq 1 30); do
if grep -Fq "Ready on $server" wrangler.log; then
break
fi
sleep 1
done
if ! grep -Fq "Ready on $server" wrangler.log; then
cat wrangler.log
exit 1
fi
node --input-type=module <<'JS'
import assert from "node:assert/strict";
const date = new Date().toUTCString().replace(/GMT$/, "+0000");
for (const count of [99, 100, 101]) {
const ids = Array.from({ length: count }, (_, index) => "<previous-" + index + "@example.net>");
const incoming = [
"From: [email protected]",
"To: [email protected]",
"Date: " + date,
"Subject: References boundary",
"Message-ID: <boundary-" + count + "@example.net>",
"In-Reply-To: " + ids.at(-1),
"References: " + ids.join("\r\n "),
"MIME-Version: 1.0",
"Content-Type: text/plain; charset=utf-8",
"",
"Please reply to this fixture.",
"",
].join("\r\n");
const url = "http://127.0.0.1:28676/cdn-cgi/local/email?from=sender%40example.net&to=reply-worker%40example.com&format=json";
const response = await fetch(url, { method: "POST", body: incoming });
const { outcome, replies } = await response.json();
console.log(JSON.stringify({ count, status: response.status, outcome, replies: replies.length }));
assert.equal(response.status, count === 99 ? 200 : 500);
assert.equal(replies.length, count === 99 ? 1 : 0);
}
JS
grep -Fc 'References" header has more than 100 entries' wrangler.log
Expected behavior
The structured reply should succeed once for each valid local fixture with 99 or 100 incoming References entries. The 101-entry fixture should hit the documented limit and produce no reply.
Actual behavior
The 99-entry control returned HTTP 200 and one reply. Both the 100- and 101-entry fixtures returned HTTP 500 and zero replies. Wrangler logged that the References header had more than 100 entries once for each rejected fixture, including the one with exactly 100.
{"count":99,"status":200,"outcome":"ok","replies":1}
{"count":100,"status":500,"outcome":"exception","replies":0}
{"count":101,"status":500,"outcome":"exception","replies":0}
Runtime or environment
- Wrangler 4.166.0, bundled Miniflare 5.20261119.0-beta, workerd 1.20261119.1, Node.js 26.13.1, macOS 27.2.1 arm64.
- Released Miniflare source for the replyability check.
Evidence
- Expected source: The Email Routing limits table and the Email Routing Workers API both specify that replies are rejected above 100 incoming
Referencesentries. The Email Service changelog documents testing reply behavior locally with Wrangler. - Failure source: The local
/cdn-cgi/local/emailendpoint produced the three paired observations above. The released source linked under Runtime or environment counts the references and rejects>= 100. The reported behavior was observed in the local emulator. - Evidence provenance: observed
- Local verification: reproduced
- Reproduction completeness: complete
Restoration check
With the same Worker and adjacent fixtures, the 99- and 100-entry submissions should each return HTTP 200 and record one reply. The 101-entry submission should still return HTTP 500 with zero replies and identify the References limit in the local log.
Triage assessment
- Impact level: P2
- Assessment status: supported
- Impact basis: The local simulator incorrectly blocks reply testing at the single documented boundary, so a Worker tested with a full-length thread appears to reject a supported input.
- Workaround status: none
- Workaround basis: Shortening the fixture changes the input responsible for the requested test and no local alternative for exercising the same boundary was observed.
- Lingua principale
- TypeScript
- Stelle
- 4.7k
- Fork
- 1.7k
- Merge medio
- 1g 22h
- PR unite (30g)
- 287
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudflare/workers-sdk
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
cloudflare/workers-sdk#17159 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudflare/workers-sdk#17158 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
cloudflare/workers-sdk#17139 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
cloudflare/workers-sdk#17110 ·
I maintainer di solito rispondono entro 1 giorno
-
D1 Time Travel restore help advertises 30 days without a plan qualifierForse di nuovo libera @akhil9tiet l’ha presa 7 giorni fa e non c’è nessuna pull request aperta. Apertabug package:wrangler product:d1
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
cloudflare/workers-sdk#17000 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudflare/workers-sdk
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
GetStream/stream-chat-react#3467 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
vercel-labs/ui#1139 ·
I maintainer di solito rispondono entro 1 giorno
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Forse già presa @goranai l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bot:ai-assisted component:platform-js status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
midnightntwrk/platform-js#93 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100