Repository navigation
fix(inbound): keep email.received events under the EventBridge size limit - #197
Merged
Merged
Conversation
…imit The inbound Lambda put the whole parsed email in the EventBridge detail. A large mail could exceed the PutEvents entry limit (1 MB; 256 KB in ap-southeast-5/6/7, ap-east-2, mx-central-1 and GovCloud), so the Lambda failed and retried while the mail never reached the consumer. Oversized details now drop html, text and headers (then attachments, then recipients) with truncated, truncatedFields and parsedS3Key, so consumers can fetch the full parsed JSON from S3. Small mail is sent unchanged. A FailedEntryCount > 0 response now throws so the Lambda retries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015wXo12iE7EnsbdjDvgqR1B
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The inbound Lambda (
packages/core/lambda/inbound-processor) put the whole parsed email into theemail.receivedEventBridge detail. A large mail could exceed the PutEvents entry limit, soPutEventsfailed, the Lambda retried, and the mail never reached the consumer even thoughraw/andparsed/were already in S3.parsed/{emailId}.json.html,text,headers(largest first), thenattachments(attachmentCountkept), thento/cc(counts kept, subject cut to 1,000 chars), then a bounded envelope. Every trimmed detail carriestruncated: true,truncatedFieldsandparsedS3Keyso consumers can fetch the full JSON.FailedEntryCount > 0(a failed entry inside a 200) now throws, so the Lambda retries instead of silently losing the event.packages/core/CLAUDE.md(also fixes its env var list).Found by a real round trip of
@byo-oss/support's inbound path through a Wraps inbound stack.Checks
pnpm --filter @wraps/core test: 13 files, 172 passed (inbound-processor 24, up from 16)pnpm --filter @wraps/core typecheck,pnpm --filter wraps-website typecheck: cleanpnpm --filter @wraps/core build:lambda(the other bundles came out byte-identical)Follow-ups (not in this PR)
packages/email/README.mdhandler example:text/htmlcan benullwhentruncatedis set; fetchparsedS3Key.parsed//attachments/objects under a newemailId(pre-existing).🤖 Generated with Claude Code
https://claude.ai/code/session_015wXo12iE7EnsbdjDvgqR1B