Skip to content

fix(result): avoid mutating errors when pickling task results - #715

Open
wsjwu58-cmd wants to merge 1 commit into
taskiq-python:masterfrom
wsjwu58-cmd:fix/pickle-result-state-copy
Open

wsjwu58-cmd wants to merge 1 commit into
taskiq-python:masterfrom
wsjwu58-cmd:fix/pickle-result-state-copy

Conversation

@wsjwu58-cmd

Copy link
Copy Markdown

Pickling a TaskiqResult whose exception needs a pickle-safe fallback currently replaces error on the original result as well. For example, an exception class defined inside a function is replaced by an internal wrapper, so a subsequent raise_for_error() on the original result raises that wrapper.

Copy the model's field mapping before preparing the serialized exception. The serialized fallback stays unchanged. The regression checks the round-trip error message and verifies that the original result still raises the same exception object.

Validation: 36 focused result/serialization tests passed, along with Ruff and Black on the changed files and MyPy over taskiq and tests (144 files). The full prek run could not complete because Windows denied writing a hook dependency's temporary wheel; the full test suite and cross-platform CI matrix were not run.

Prepared with AI assistance; the patch was independently reviewed and checked locally.

Copilot AI balanced review requested due to automatic review settings October 25, 2026 03:00

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
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