Skip to content

Commit 6024ec1

Browse files
committed
fixup! fix(@angular/ssr): destroy platform when request is aborted during rendering
1 parent 5379713 commit 6024ec1

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

‎packages/angular/ssr/src/app.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,11 @@ export class AngularServerApp {
353353
controller.enqueue(this.textEncoder.encode(renderedHtml));
354354
controller.close();
355355
} catch (error) {
356-
result.destroy();
356+
await result.destroy();
357357
controller.error(error);
358358
}
359359
},
360-
cancel: () => {
361-
result.destroy();
362-
},
360+
cancel: () => result.destroy(),
363361
});
364362

365363
return new Response(stream, responseInit);

‎packages/angular/ssr/src/utils/ng.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export async function renderAngular(
6767
hasNavigationError: boolean;
6868
redirectTo?: string;
6969
content: () => Promise<string>;
70-
destroy: () => void;
70+
destroy: () => Promise<void>;
7171
}
7272
> {
7373
if (signal?.aborted) {

0 commit comments

Comments
 (0)