Skip to content

[LiveComponent] Fix proxy turning "toJSON" and "then" protocol probes into server actions - #3791

Merged
Kocal merged 1 commit into
symfony:3.xfrom
Amoifr:fix-3752-proxy-protocol-probes
Aug 21, 2026
Merged

Kocal merged 1 commit into
symfony:3.xfrom
Amoifr:fix-3752-proxy-protocol-probes

Conversation

@Amoifr

@Amoifr Amoifr commented Aug 18, 2026

Copy link
Copy Markdown
Contributor
Q A
Bug fix? yes
New feature? no
Docs? no
Issues Fix #3752
License MIT

The component proxy treats any unknown property read as a server action. JSON.stringify() probes toJSON, and promise assimilation (e.g. await component, or returning the proxy from an async function) probes then: both received a callable and invoked it, queueing a phantom server action named toJSON or then.

This PR returns undefined for these two protocol probes. The guard sits after the model lookup, so a model actually named toJSON or then keeps priority; only the "unknown name = action" fallback is skipped. Same family of fix as #2537, which stopped JSON.stringify() from serializing __component.

Tests cover both probes (no action queued, await resolves to the proxy itself) and the model-priority case.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

📊 Packages dist files size difference

ℹ️ No difference in dist packagesFiles.

@Kocal

Kocal commented Aug 20, 2026

Copy link
Copy Markdown
Member

Please target 3.x branch

@Amoifr
Amoifr force-pushed the fix-3752-proxy-protocol-probes branch from 0d97fae to 80d3c5f Compare August 20, 2026 13:36
@Amoifr
Amoifr requested a review from Kocal as a code owner August 20, 2026 13:36
@Amoifr
Amoifr changed the base branch from 2.x to 3.x August 20, 2026 13:37
@Amoifr

Amoifr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Done! Rebased onto 3.x, dist rebuilt from the 3.x sources, JS suite green (297 tests), base switched.

@Kocal

Kocal commented Aug 20, 2026

Copy link
Copy Markdown
Member

Dist files must be rebuild

@Amoifr

Amoifr commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Rebuilt the dist with the current toolchain (Node 22 + pnpm, same as the dist-files-unbuilt job) and pushed. Sorry for the noise!

@Kocal
Kocal force-pushed the fix-3752-proxy-protocol-probes branch from c347f16 to d0f3f8b Compare August 21, 2026 12:58
@Kocal

Kocal commented Aug 21, 2026

Copy link
Copy Markdown
Member

I just added a small note in the documentation, merging when it's green

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Aug 21, 2026
@Kocal
Kocal force-pushed the fix-3752-proxy-protocol-probes branch from d0f3f8b to 87621bf Compare August 21, 2026 13:07
@Kocal

Kocal commented Aug 21, 2026

Copy link
Copy Markdown
Member

Thank you @Amoifr.

@Kocal
Kocal merged commit d217844 into symfony:3.x Aug 21, 2026
35 checks passed
@Kocal Kocal added the Documentation Improvements or additions to documentation label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix Documentation Improvements or additions to documentation LiveComponent Status: Reviewed Has been reviewed by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LiveComponent] Component proxy turns "toJSON"/"then" property probes into real server actions

3 participants