Skip to content

fix(workflow): send falsy event data in raise_workflow_event - #1376

Open
Indian-boult wants to merge 1 commit into
dapr:mainfrom
Indian-boult:fix/workflow-raise-event-falsy-data
Open

Indian-boult wants to merge 1 commit into
dapr:mainfrom
Indian-boult:fix/workflow-raise-event-falsy-data

Conversation

@Indian-boult

Copy link
Copy Markdown

Description

raise_orchestration_event_with_result in the sync and async durabletask clients built the event input with if data else None. An event raised with False, 0, '', [] or {} was sent with no input, and the workflow received None. Both clients now set the input whenever data is not None, the same check schedule_new_orchestration_with_result uses in the same files.

New tests in tests/ext/workflow/durabletask/test_client.py and test_client_async.py send each falsy value and check the request carries it, and check that data=None still sends no input. The falsy cases fail on main and pass with this change. ruff and mypy are clean, and the unit tests pass apart from test_binarystore*.py cases that also fail now and then on a clean main.

Issue reference

Please reference the issue this PR will close: #1375

Checklist

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

raise_orchestration_event_with_result built the request input with
"if data else None" in the sync and async durabletask clients, so an
event raised with False, 0, "", [] or {} reached the workflow as None.

Both clients now set the input whenever data is not None, the same
check schedule_new_orchestration_with_result uses.

Fixes dapr#1375

Signed-off-by: Indian-boult <neeraj.khatri.work@gmail.com>
@Indian-boult
Indian-boult requested review from a team as code owners November 20, 2026 09:36
@CasperGN CasperGN self-assigned this Nov 20, 2026

@CasperGN CasperGN 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.

Thanks @Indian-boult for your interest in Dapr and for tracking this one down 🙌 Switching to data is not None in both the sync and async clients lines up with how schedule_new_orchestration_with_result already handles input. The parametrized tests covering False, 0, '', [] and {}, plus the None case, pin the behaviour down nicely 🧪

A few more notes:

  • nit: terminate_orchestration has the same truthiness check on its output, at client.py#L598 and aio/client.py#L382, so terminating with output=False or 0 drops the output in the same way. What do you think about switching those to is not None too, either here or in a follow-up?
  • So far DCO is the only check reported on this head. I'm happy to approve once the unit tests run green.

Drafted with AI assistance and reviewed by me.

@Indian-boult

Copy link
Copy Markdown
Author

Thanks for the review. #1371 already replaces that check in both clients with an is not None test, as part of adding a termination reason, so I left those lines alone here to keep the two PRs from conflicting. If #1371 does not land, I'm happy to send the terminate fix as a follow-up.

@CasperGN CasperGN 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.

Round 2 of 3: follow-up on the changes since ec4e248.

Every earlier blocker is resolved and the new changes add none.

Resolved since the last round: 1.

Drafted with AI assistance and reviewed by me.

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.

[WORKFLOW SDK BUG] raise_workflow_event drops falsy event data and the workflow receives None

2 participants