Skip to content

Copy task state without mutating its data - #721

Merged
s3rius merged 1 commit into
taskiq-python:masterfrom
IlyaKhalafi:campaign30/2026-11-06/taskiq
Nov 7, 2026
Merged

s3rius merged 1 commit into
taskiq-python:masterfrom
IlyaKhalafi:campaign30/2026-11-06/taskiq

Conversation

@IlyaKhalafi

Copy link
Copy Markdown
Contributor

This PR fixes TaskiqState.copy mutating the original mapping and overwriting a user data key. With this, it returns an independent shallow copy through the existing copy protocol.

Fixes #720

Eight state tests pass, including two regressions that fail before the fix. The full suite has 374 passing tests and one forkserver logging failure that also occurs on upstream. Ruff, Black and focused mypy checks pass.

@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.49%. Comparing base (f08a54a) to head (3fc12d7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #721      +/-   ##
==========================================
+ Coverage   85.48%   85.49%   +0.01%     
==========================================
  Files          68       68              
  Lines        2660     2662       +2     
==========================================
+ Hits         2274     2276       +2     
  Misses        386      386              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@s3rius
s3rius merged commit 9214379 into taskiq-python:master Nov 7, 2026
19 checks passed
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.

TaskiqState.copy mutates the source and overwrites the data key

2 participants