Skip to content

EMAIL-1739 Add EmailFwdr external, expose raw on EmailMessage - #8540

Merged
danlapid merged 1 commit into
cloudflare:mainfrom
Skye-31:skye/email-fwdr-external
Nov 23, 2026
Merged

danlapid merged 1 commit into
cloudflare:mainfrom
Skye-31:skye/email-fwdr-external

Conversation

@Skye-31

@Skye-31 Skye-31 commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Add JsValue.External.emailFwdr, a capability wrapper for the EmailFwdr that an inbound email event carries for forward() and reply(). EmailMessage and ForwardableEmailMessage are implemented outside workerd, so the capability is opaque here. It is classified as ineligible for replay, like the other capability-backed externals.

Move raw from ForwardableEmailMessage up to EmailMessage in the public typings, and regenerate the type snapshots. A worker that receives an EmailMessage over RPC needs to read its body, and the implementation exposes raw on the base class.

Needed for an upstream change making EmailMessage and ForwardableEmailMessage serializable over JS RPC.

Add JsValue.External.emailFwdr, a capability wrapper for the
EmailFwdr that an inbound email event carries for forward() and
reply(). EmailMessage and ForwardableEmailMessage are implemented
outside workerd, so the capability is opaque here. It is classified as
ineligible for replay, like the other capability-backed externals.

Move `raw` from ForwardableEmailMessage up to EmailMessage in the
public typings, and regenerate the type snapshots. A worker that
receives an EmailMessage over RPC needs to read its body, and the
implementation exposes `raw` on the base class.

Needed for an upstream change making EmailMessage and
ForwardableEmailMessage serializable over JS RPC.
@Skye-31
Skye-31 requested review from a team as code owners November 17, 2026 13:59
@clanky-the-clanker

Copy link
Copy Markdown

This pull request was not reviewed automatically because its author does not have write access to this repository. A maintainer with write access can start a review by commenting clanky review (or clanker review or @clanky-the-clanker review), optionally followed by instructions (e.g. clanky review focus on the retry logic).

@petebacondarwin petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like exposing raw is a pure typings change? Was it already part of the runtime type?

@Skye-31

Skye-31 commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Looks like exposing raw is a pure typings change? Was it already part of the runtime type?

Yes, we're moving it from the ForwardableEmailMessage class to the parent EmailMessage class as part of the work to make it possible to send EmailMessages over JSRPC

@Skye-31
Skye-31 enabled auto-merge November 23, 2026 10:39
@danlapid
danlapid disabled auto-merge November 23, 2026 17:06
@danlapid
danlapid merged commit e622ff5 into cloudflare:main Nov 23, 2026
31 of 35 checks passed
@Skye-31
Skye-31 deleted the skye/email-fwdr-external branch November 23, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants