Skip to content

fix: avoid serializing computed signal values by default - #8860

Open
Varixo wants to merge 1 commit into
mainfrom
codex/fix-computed-signals-serialization-security-issue
Open

fix: avoid serializing computed signal values by default#8860
Varixo wants to merge 1 commit into
mainfrom
codex/fix-computed-signals-serialization-security-issue

Conversation

@Varixo

@Varixo Varixo commented Jul 17, 2026

Copy link
Copy Markdown
Member

Motivation

  • A recent change made computed signals default to serializationStrategy: 'always', which caused evaluated computed values to be written into the SSR-embedded qwik/state and risked leaking server-only or sensitive derived data.
  • The intent of this PR is to restore the safer previous default (computed signals do not serialize their cached value) while preserving the existing always default for async signals.

Description

  • Changed the computed-signal construction to use getComputedSignalFlags(options?.serializationStrategy || 'never') so computed signals default to never when no explicit serializationStrategy is provided (packages/qwik/src/core/reactive-primitives/signal-api.ts).
  • Left async-signal defaults unchanged so async signals still default to always (packages/qwik/src/core/reactive-primitives/signal-api.ts).
  • Updated the public SerializationStrategy documentation to explicitly distinguish that computed signals default to never and async signals default to always (packages/qwik/src/core/shared/types.ts).
  • Added/updated focused serialization coverage to assert that a default computed signal does not serialize its cached value while an explicit always-configured computed still does, and updated the inline snapshot accordingly (packages/qwik/src/core/shared/serdes/serdes.unit.ts).
  • Added a patch changeset for @qwik.dev/core (.changeset/calm-computed-secrets.md).

Testing

  • pnpm dlx @intellectronica/ruler@0.3.42 apply --no-gitignore --no-mcp was attempted and failed in this environment due to a registry 403 (environmental artifact, not related to the code change).
  • pnpm build.core.dev completed successfully and produced the development build artifacts.
  • Focused unit tests were run with pnpm vitest run packages/qwik/src/core/shared/serdes/serdes.unit.ts -t "ComputedSignal" --reporter=verbose and the failing snapshot was updated to reflect the new default; the focused run passed after the update.
  • The full serialization unit file was run with pnpm vitest run packages/qwik/src/core/shared/serdes/serdes.unit.ts --reporter=verbose and completed with all tests in that file passing.
  • Repository checks (git diff --check) were run as part of the verification and reported no problems with the modified files.

Codex Task

@Varixo
Varixo requested a review from a team as a code owner July 17, 2026 15:23
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e067928

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@qwik.dev/core Patch
eslint-plugin-qwik Patch
@qwik.dev/react Patch
@qwik.dev/router Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@maiieul maiieul moved this to Waiting For Review in Qwik Development Jul 17, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8860

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8860

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8860

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8860

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8860

@qwik.dev/devtools

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/devtools@8860

commit: e067928

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview e067928

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Waiting For Review

Development

Successfully merging this pull request may close these issues.

2 participants