fix(http): delay accessing pendingTasks.whenAllTasksComplete#49784
fix(http): delay accessing pendingTasks.whenAllTasksComplete#49784alan-agius4 wants to merge 2 commits intoangular:mainfrom
Conversation
4171dd0 to
78c32f4
Compare
AndrewKushnir
left a comment
There was a problem hiding this comment.
Thanks for the fixes @alan-agius4 👍
I've left a minor comment, but let's address it in a followup PR (we can proceed with the merge using the current state).
Another quick question (also for a followup): would it be possible to create a couple test cases for this change, so that we don't regress in the future?
Thank you.
There was a problem hiding this comment.
nit: I think it'd be great to add a comment to mention:
- why we do the nesting of promises
- why the
APP_INITIALIZERtoken is used (and the fact that we don't delay the bootstrap, we just subscribe sooner)
Current in the `InitialRenderPendingTasks` when the `collection` size is 0 a new promise is created a the status is changed to completed. This causes the promise that is created during the class initialization phase to never be resolved which causes SSR to hang indefinitely.
Accessing `pendingTasks.whenAllTasksComplete` too early causes the `InitialRenderPendingTasks` to return a resolved promise too early. This commit changes the way we access `whenAllTasksComplete` to only happen when the application is stabilized.
78c32f4 to
2e30f1b
Compare
|
FYI I've pushed a rebase to resolve the merge conflict, which happened around the imports section (no actual conflicts in the logic itself). We can reuse previous g3 presubmit (which was "green") and proceed with the merge. |
|
This PR was merged into the repository by commit f9b821f. |
Accessing `pendingTasks.whenAllTasksComplete` too early causes the `InitialRenderPendingTasks` to return a resolved promise too early. This commit changes the way we access `whenAllTasksComplete` to only happen when the application is stabilized. PR Close #49784
Accessing `pendingTasks.whenAllTasksComplete` too early causes the `InitialRenderPendingTasks` to return a resolved promise too early. This commit changes the way we access `whenAllTasksComplete` to only happen when the application is stabilized. PR Close #49784
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
fix(http): delay accessing
pendingTasks.whenAllTasksCompleteAccessing
pendingTasks.whenAllTasksCompletetoo early causes theInitialRenderPendingTasksto return a resolved promise too early. This commit changes the way we accesswhenAllTasksCompleteto only happen when the application is stabilized.fix(core): resolve
InitialRenderPendingTaskspromise on completeCurrent in the
InitialRenderPendingTaskswhen thecollectionsize is 0 a new promise is created a the status is changed to completed. This causes the promise that is created during the class initialization phase to never be resolved which causes SSR to hang indefinitely.