Skip to content

Commit 2c380ea

Browse files
committed
Feedback - rename + comment.
1 parent c89cd57 commit 2c380ea

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.EventDispatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private void SetNotFoundResponse(object? sender, EventArgs args)
8181
throw new InvalidOperationException("Cannot set a NotFound response after the response has already started.");
8282
}
8383
_httpContext.Response.StatusCode = StatusCodes.Status404NotFound;
84-
StopRenderer();
84+
SignalRendererToFinishRendering();
8585
}
8686

8787
private void UpdateNamedSubmitEvents(in RenderBatch renderBatch)

src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ protected override void AddPendingTask(ComponentState? componentState, Task task
176176
base.AddPendingTask(componentState, task);
177177
}
178178

179-
private void StopRenderer()
179+
private void SignalRendererToFinishRendering()
180180
{
181181
_rendererIsStopped = true;
182182
}
@@ -185,6 +185,9 @@ protected override void ProcessPendingRender()
185185
{
186186
if (_rendererIsStopped)
187187
{
188+
// When the application triggers a NotFound event, we continue rendering the current batch.
189+
// However, after completing this batch, we do not want to process any further UI updates,
190+
// as we are going to return a 404 status and discard the UI updates generated so far.
188191
return;
189192
}
190193
base.ProcessPendingRender();

0 commit comments

Comments
 (0)