Handle premature request cancellation during workflow resumption

- Use `CancellationToken.None` to avoid canceling workflow execution when clients, like Blazor, terminate requests prematurely.
- Add comments for clarification on potential causes.
This commit is contained in:
Sipke Schoorstra 2025-09-17 15:25:59 +02:00
parent f2d3c540ee
commit 5fb25170cf
No known key found for this signature in database
GPG key ID: 5C10502B28A4268F

View file

@ -38,7 +38,11 @@ internal class Resume(ITokenService tokenService, IWorkflowResumer workflowResum
return;
}
await ResumeBookmarkedWorkflowAsync(payload, input, asynchronous, cancellationToken);
// Some clients, like Blazor, may prematurely cancel their request upon navigation away from the page.
// In this case, we don't want to cancel the workflow execution.
// We need to better understand the conditions that cause this.
var workflowCancellationToken = CancellationToken.None;
await ResumeBookmarkedWorkflowAsync(payload, input, asynchronous, workflowCancellationToken);
if (!HttpContext.Response.HasStarted)
await SendOkAsync(cancellationToken);