Files
angular/packages/platform-server
Matthieu Riegler ea96450ee8 fix(core): guard hydrating map access and release pending task on error
`triggerHydrationForBlockQueue` accessed `blocksBeingHydrated.get(dehydratedBlockId)` with a non-null assertion `!.resolve()`. If the entry was cleaned up while the function was suspended awaiting resource loading or next render, this resulted in an unhandled `TypeError: Cannot read properties of undefined (reading 'resolve')`.

Additionally, the pending task added by `pendingTasks.add()` was not guarded by a `try/finally`, causing the task to leak and permanently breaking application stability whenever hydration encountered an error or threw an exception.

This commit optional-chains `.resolve()` matching sibling accesses and wraps the queue processing loop in `try/finally` so `pendingTasks.remove(taskId)` is always invoked.

Fixes #71769

(cherry picked from commit af620ea3d9)
2026-11-10 20:31:07 +00:00
..
2024-03-28 13:02:50 -07:00