Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented May 2, 2025

The internal karma common middleware that handles requests converts the to be cached data into a string when stored. This can lead to invalid data when the cached string is then sent in a followup request if the original content was not intended to be a string. To avoid this problem, asset files are now explicitly not cached by karma's middleware.
Ref: https://github.com/karma-runner/karma/blob/84f85e7016efc2266fa6b3465f494a3fa151c85c/lib/middleware/common.js#L72

(cherry picked from commit 90d1db3)

Closes #30198

@clydin clydin added the target: patch This PR is targeted for the next patch release label May 2, 2025
@clydin clydin linked an issue May 2, 2025 that may be closed by this pull request
1 task
@clydin clydin requested a review from jkrems May 2, 2025 21:31
@jkrems jkrems added the action: merge The PR is ready for merge by the caretaker label May 4, 2025
@jkrems
Copy link
Contributor

jkrems commented May 4, 2025

This might need a rebase to pick up the CI fix, doesn't look like rerunning the failure picks up the latest merge head.

The internal karma common middleware that handles requests converts
the to be cached data into a string when stored. This can lead to invalid data
when the cached string is then sent in a followup request if the original content
was not intended to be a string. To avoid this  problem, asset files are now
explicitly not cached by karma's middleware.
Ref: https://github.com/karma-runner/karma/blob/84f85e7016efc2266fa6b3465f494a3fa151c85c/lib/middleware/common.js#L72

(cherry picked from commit 90d1db3)
@clydin clydin force-pushed the karma/binary-assets-19.2.x branch from 0aee2ee to 3cb12e2 Compare May 4, 2025 20:45
@clydin clydin merged commit 009fc37 into angular:19.2.x May 4, 2025
30 checks passed
@clydin clydin deleted the karma/binary-assets-19.2.x branch May 4, 2025 22:34
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unit tests using esbuild + Vite fail when reloading using Sqlite wasm

2 participants