Skip to content

Propagated history changes#1833

Merged
WhitWaldo merged 9 commits into
masterfrom
propagated-history-changes
May 28, 2026
Merged

Propagated history changes#1833
WhitWaldo merged 9 commits into
masterfrom
propagated-history-changes

Conversation

@WhitWaldo

Copy link
Copy Markdown
Contributor

Description

Making a few tweaks + added unit tests to the implementation to support the propagated history implementation.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

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

WhitWaldo added 4 commits May 27, 2026 16:31
…low status

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…dded missing unit tests.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
@WhitWaldo WhitWaldo added this to the v1.18 milestone May 27, 2026
@WhitWaldo WhitWaldo self-assigned this May 27, 2026
@WhitWaldo WhitWaldo requested review from a team as code owners May 27, 2026 22:20
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.46%. Comparing base (5ad31e6) to head (333b6c0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1833   +/-   ##
=======================================
  Coverage   63.46%   63.46%           
=======================================
  Files         312      312           
  Lines        9279     9279           
  Branches     1101     1101           
=======================================
  Hits         5889     5889           
  Misses       3130     3130           
  Partials      260      260           
Flag Coverage Δ
net10.0 63.45% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

WhitWaldo added 2 commits May 27, 2026 17:37
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
/// <param name="result">When this method returns <see langword="true"/>, the last matching workflow entry; otherwise <see langword="null"/>.</param>
/// <returns><see langword="true"/> if a matching entry was found; otherwise <see langword="false"/>.</returns>
public bool TryGetLastWorkflowByName(string name, [NotNullWhen(true)] out PropagatedHistoryEntry? result)
public bool TryGetLastWorkflowEventByName(string name, [NotNullWhen(true)] out PropagatedHistoryEvent? result)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why Try? All the other sdks have GetLastWorkflowEventByName without Try. Is this more of a dotnet consistency thing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A null in a response can mean so many things. Taking a recent example from the state store - if you query a value from state and you get a null back, does that mean that the value didn't exist or that it did and it is null? A TryGet answers this definitively.

Especially as these are not asynchronous operations, I'd rather return a clear boolean indicating if getting the value(s) worked or not and include a payload with the corresponding result if it did.

Comment thread src/Dapr.Workflow.Abstractions/PropagatedHistoryActivityResult.cs Outdated
/// </remarks>
public sealed record PropagatedHistoryWorkflowResult(
string Name,
PropagatedHistoryTaskStatus Status,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same as above - could we rename to something like WorkflowStatus? PropagatedHistoryTaskStatus on a workflow result is a bit confusing too, since task usually refers to activities, but end users don't even know that. Users just care about the status, not the propagated history internals.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They're the same type as above - just refactored to PropagatedHistoryStatus so it's generically used for either one.

/// <see cref="PropagatedHistory"/>. Use <see cref="TryGetLastActivityByName"/> and
/// <see cref="TryGetLastChildWorkflowByName"/> to look up specific items in this entry;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe I missed this in our DMs, we do support a top level GetLastWorkflowByName/GetWorkflowsByName in the go-sdk. This returns a WorkflowResult. In dotnet you have TryGetLastWorkflowEventByName/GetEventsByWorkflowName returning PropagatedHistoryEvent.

In go, off of WorkflowResult.GetLastChildWorkflowByName/GetChildWorkflowsByName I return the ChildWorkflowResult. In dotnet child is dropped. Can we re-add that on PropagatedHistoryEvent?

@WhitWaldo WhitWaldo May 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not super worried about having a bunch of variations of the filters. I expose all the events in a property, so if there's some special filter a developer wishes to apply, they can trivially add it themselves.

Also, yes, .NET has filters on the list of all propagated history events to return a single PropagatedHistoryEvent as you noted. But this also has filters within it for the specific workflows and activities you cite, so I think the bases are probably already covered here.

WhitWaldo added 3 commits May 28, 2026 09:56
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
… removed method

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants