Fix error related to case sensitivity for email routing#992
Fix error related to case sensitivity for email routing#992threepointone merged 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: eabdf7a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
|
/bonk review this |
|
Now I have a complete picture of the changes. Here's my review: Code Review: Fix case-sensitivity for email routingSummaryThe PR adds a third lookup key ( What's Good
IssuesMinor — package-lock.json noise The Nit — potential key collision If a user has two different bindings where Nit — the resolver doesn't lowercase its input The VerdictThe fix is correct, well-tested, and low-risk. The |
Co-authored-by: Muhammad Ali <muhammadali@cloudflare.com>
Resolves #988
Fix email routing for mail-server-lowercased agent names
Closes the case-sensitivity gap in
routeAgentEmailwhere email infrastructure lowercases addresses before delivery, causing PascalCase agent bindings to fail lookup.Problem
Email servers normalize addresses to lowercase. When a user sends to
SomeAgent+123@domain.com, the Worker receivessomeagent+123@domain.com. The router's lookup map only contained:SomeAgent(original binding name)some-agent(kebab-case, added in v0.0.106)The plain-lowercase
someagenthad no match, producing:Fix
Register a third key —
key.toLowerCase()— in the agent map alongside the existing original and kebab-case entries. The map now contains:SomeAgent→ namespacesome-agent→ namespacesomeagent→ namespaceAlso refactored the cache to store original binding names separately, so the error message lists only original names without lowercase/kebab duplicates.
Generated by Opencode