Skip to content

fix(sdk): make payload codec failable - #1431

Merged
chris-olszewski merged 6 commits into
mainfrom
olszewski/fix_failable_codec
Jul 29, 2026
Merged

chris-olszewski merged 6 commits into
mainfrom
olszewski/fix_failable_codec

Conversation

@chris-olszewski

Copy link
Copy Markdown
Member

What was changed

  • Update PayloadCodec trait methods to now return Result<_, PayloadConversionError>
  • Update AsyncPayloadVisitor::visit to be faillable, PayloadVisitable::visit_payloads_mut is now responsible for failing when a visitor fails. Generated PayloadVisitable impls now have ? after their visit calls.
  • activity/workflow completions will fall back to non-encoded failure if encoding fails. From what I can tell this is behavior of the other SDKs
  • Adding ?

Why?

Discovered this while working on client interceptors, codecs certainly can fail.

Checklist

  1. Closes N/A

  2. How was this tested:
    Added integration tests to verify codec failures result in failed tasks that are retried. Small unit tests to ensure we fallback to un-encoded failures if a codec operation fails along with ensuring codec failures abort streaming responses.

  3. Any docs updates needed?
    N/A

@chris-olszewski
chris-olszewski requested a review from a team as a code owner July 29, 2026 14:49
Next::new({
let mut rpc_client = client.clone();
move |input: ListSchedulesPageInput| -> BoxFuture<
fn list_schedules_stream<CT>(client: CT, opts: ListSchedulesOptions) -> ListSchedulesStream

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Don't love this, but easiest way to allow us to hit this function with a fake client.

Comment thread crates/client/src/workflow_handle.rs Outdated

@Sushisource Sushisource left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh, not sure how I just skipped that lol

@chris-olszewski

Copy link
Copy Markdown
Member Author

Huh, not sure how I just skipped that lol

Not sure how I only noticed it last week 🙈

@chris-olszewski
chris-olszewski enabled auto-merge (squash) July 29, 2026 20:23
@chris-olszewski
chris-olszewski merged commit 3b121af into main Jul 29, 2026
39 of 40 checks passed
@chris-olszewski
chris-olszewski deleted the olszewski/fix_failable_codec branch July 29, 2026 20:59
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.

2 participants