Skip to content

test(core): cover client-only computed resume captures - #9109

Merged
Varixo merged 1 commit into
QwikDev:mainfrom
akasakariko:fix/client-only-computed-resume
Oct 6, 2026
Merged

Varixo merged 1 commit into
QwikDev:mainfrom
akasakariko:fix/client-only-computed-resume

Conversation

@akasakariko

Copy link
Copy Markdown
Contributor

What is it?

  • Docs / tests / types / typos

Description

Closes #9081

The runtime fix is already on main in 04dd9c8 (fix(core): singleton for QRL captures), which snapshots the capture array before _res starts computations

This PR adds the missing regression coverage rather than duplicating that implementation change

  • Exercise two real client-only async signals with preloaded compute QRLs whose lexical scopes replace the shared captures during invocation
  • Serialize two client-only computeds and resume them through _res using capture deltas and a paused DOM container
  • Assert that both computations start before reading signal state or calling promise(), since those operations could otherwise start skipped computations and hide the regression
  • Clear the shared captures after each bind-handler test

Regression proof

Temporarily restored the old loop that reads the shared capture array on every iteration

  • Both new tests fail because the second signal never starts
  • The seven existing tests still pass
  • Restoring the upstream snapshot implementation makes all nine bind-handler tests pass

Validation

  • pnpm build.core.dev
  • pnpm build.core
  • pnpm tsc.check
  • pnpm vitest run packages/qwik/src/core/shared/jsx packages/qwik/src/core/shared/qrl packages/qwik/src/core/shared/serdes packages/qwik/src/core/reactive-primitives/impl/async-signal.unit.tsx packages/qwik/src/core/reactive-primitives/impl/async-computed.unit.tsx
    • 13 files passed, 368 tests passed, 16 skipped and 12 todo
  • pnpm exec eslint packages/qwik/src/core/shared/jsx/bind-handlers.unit.ts
  • pnpm exec prettier --check packages/qwik/src/core/shared/jsx/bind-handlers.unit.ts
  • git diff --check

No browser e2e or full monorepo test run was performed for this test-only change

Security review

No production serialization or execution boundary changes are introduced, and the round-trip test uses trusted in-memory fixtures with the existing serializer and deserializer

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added new tests to cover the fix / functionality
  • No changeset is needed because this PR only changes tests

@akasakariko
akasakariko requested a review from a team as a code owner October 1, 2026 04:13
@changeset-bot

changeset-bot Bot commented Oct 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0553c90

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

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

@qwik.dev/router

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

@qwik.dev/utils

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/utils@9109

eslint-plugin-qwik

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

create-qwik

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

@qwik.dev/optimizer

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

@qwik.dev/devtools

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

@qwik.dev/mcp

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/mcp@9109

commit: 0553c90

@akasakariko

Copy link
Copy Markdown
Contributor Author

Hi, just a friendly ping. This PR is ready for review whenever you have a chance. Happy to address any feedback

@Varixo Varixo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey, thanks for the PR! Sorry for the delay. LGTM

@Varixo
Varixo merged commit 2f40839 into QwikDev:main Oct 6, 2026
26 checks passed
akasakariko added a commit to akasakariko/akasakariko that referenced this pull request Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐞] Only the first clientOnly async computed starts on a cold load (_res iterates a clobbered _captures)

2 participants