Skip to content

Conversation

alan-agius4
Copy link
Contributor

The TRANSFER_STATE_SERIALIZED_FOR_APPID provider was previously configured at the platform level, causing its state to be shared across all concurrent server-side rendering requests. This created a race condition where one request could see the appId from a different, concurrent request, leading to false warnings about duplicate state serialization.

This commit changes the provider's scope to ensure that each application instance gets its own unique state. This correctly isolates the serialization check to each individual request, resolving the issue of false warnings in concurrent environments.

Closes #63524

…lization

The `TRANSFER_STATE_SERIALIZED_FOR_APPID` provider was previously configured at the platform level, causing its state to be shared across all concurrent server-side rendering requests. This created a race condition where one request could see the `appId` from a different, concurrent request, leading to false warnings about duplicate state serialization.

This commit changes the provider's scope to ensure that each application instance gets its own unique state. This correctly isolates the serialization check to each individual request, resolving the issue of false warnings in concurrent environments.

Closes angular#63524
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Sep 1, 2025
@angular-robot angular-robot bot added the area: server Issues related to server-side rendering label Sep 1, 2025
@ngbot ngbot bot added this to the Backlog milestone Sep 1, 2025
…king

The logic to track if the transfer state has been serialized is simplified by removing the need for `APP_ID`. Instead of maintaining a `Set` of application IDs, a simple boolean flag is used.
@alan-agius4
Copy link
Contributor Author

This got me thinking as the platform should actually not be shared among different requests. The problem is

if (_platformInjector) return _platformInjector;
which is not safe for concurrent request. However, right now there is no easy way to get around this.

@alan-agius4 alan-agius4 removed the request for review from thePunderWoman September 2, 2025 15:40
@pullapprove pullapprove bot requested a review from crisbeto September 2, 2025 15:40
@alan-agius4 alan-agius4 requested review from kirjs and AndrewKushnir and removed request for crisbeto September 2, 2025 15:40
Copy link
Contributor

@NothingEverHappens NothingEverHappens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: general

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 3, 2025
Copy link
Contributor

@kirjs kirjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: general

@mmalerba
Copy link
Contributor

mmalerba commented Sep 3, 2025

This PR was merged into the repository. The changes were merged into the following branches:

@mmalerba mmalerba closed this in ee73dc9 Sep 3, 2025
mmalerba pushed a commit that referenced this pull request Sep 3, 2025
…king (#63525)

The logic to track if the transfer state has been serialized is simplified by removing the need for `APP_ID`. Instead of maintaining a `Set` of application IDs, a simple boolean flag is used.

PR Close #63525
mmalerba pushed a commit that referenced this pull request Sep 3, 2025
…lization (#63525)

The `TRANSFER_STATE_SERIALIZED_FOR_APPID` provider was previously configured at the platform level, causing its state to be shared across all concurrent server-side rendering requests. This created a race condition where one request could see the `appId` from a different, concurrent request, leading to false warnings about duplicate state serialization.

This commit changes the provider's scope to ensure that each application instance gets its own unique state. This correctly isolates the serialization check to each individual request, resolving the issue of false warnings in concurrent environments.

Closes #63524

PR Close #63525
mmalerba pushed a commit that referenced this pull request Sep 3, 2025
…king (#63525)

The logic to track if the transfer state has been serialized is simplified by removing the need for `APP_ID`. Instead of maintaining a `Set` of application IDs, a simple boolean flag is used.

PR Close #63525
@alan-agius4 alan-agius4 deleted the ssr-platform branch September 3, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: server Issues related to server-side rendering target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng serve warning: Angular detected an incompatible configuration, which causes duplicate serialization of the server-side application state.
5 participants