-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(http): ensure new cache state is returned on each request #49749
Conversation
The cache state is only used only the first server request. Restarting the server uses the cache on first request. Subsequent requests skip the cache because the value is mutated. This change ensures a new cache state is returned on every request.
@brandonroberts thanks for reporting the issue and submitting a fix! We'll review it asap. I'm wondering if you could help to put together a test that reproduces the problem, which would also help to ensure that there are no regressions in the future? This might be a good place for a test and it should contain the necessary helpers: https://github.com/angular/angular/blob/main/packages/platform-server/test/integration_spec.ts#L1097. Thank you. |
Thanks @AndrewKushnir! Thanks for pointing me to the integration tests also. I wasn't sure where to start on that with it being an internal token. |
@brandonroberts thanks again for the fix! We will proceed with the merge and we plan to expand the test coverage as a followup (in conjunction with other changes). |
This PR was merged into the repository by commit 0b3677e. |
The cache state is only used only the first server request. Restarting the server uses the cache on first request. Subsequent requests skip the cache because the value is mutated. This change ensures a new cache state is returned on every request. PR Close #49749
Thanks @AndrewKushnir and @alan-agius4! |
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. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The cache state is only used only the first server request. Restarting the server uses the cache on the first request.
Subsequent requests skip the cache because the
CACHE_STATE
object is mutated.What is the new behavior?
A new cache state is returned on every server request.
Does this PR introduce a breaking change?
Other information
Angular v16.0.0-next.7 release with Universal installed and client hydration enabled
Reproduction: https://github.com/brandonroberts/angular-v16-universal-standalone
/todos
route