angular/packages/platform-server/test
Krzysztof Platis b40875a2cc fix(platform-server): destroy PlatformRef when error happens during the bootstrap() phase (#58112) (#58135)
The `bootstrap()` phase might fail e.g. due to an rejected promise in some `APP_INIIALIZER`.
If `PlatformRef` is not destroyed, then the main app's injector is not destroyed and therefore `ngOnDestroy` hooks of singleton services is not called on the end (failure) of SSR.

This could lead to possible memory leaks in custom SSR apps, if their singleton services' `ngOnDestroy` hooks contained an important teardown logic (e.g. unsubscribing from RxJS observable).

Note: I needed to fix by the way another thing too: now we destroy `moduleRef` when `platformInjector` is destroyed - by setting a `PLATFORM_DESTROY_LISTENER`

Patch port of #58112

PR Close #58135
2024-10-09 13:50:02 +00:00
..
BUILD.bazel refactor(core): Use event_dispatcher in event_replay code. (#56036) 2024-05-29 12:59:23 +02:00
dom_utils.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
event_replay_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
hydration_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
integration_spec.ts fix(platform-server): destroy PlatformRef when error happens during the bootstrap() phase (#58112) (#58135) 2024-10-09 13:50:02 +00:00
transfer_state_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00