Skip to content

fix: Runtime scalars failing validation during HMR and builds - #1751

Merged
AlecAivazis merged 1 commit into
HoudiniGraphql:mainfrom
knd775:feature/fix-incremental-runtime-scalars
Sep 27, 2026
Merged

AlecAivazis merged 1 commit into
HoudiniGraphql:mainfrom
knd775:feature/fix-incremental-runtime-scalars

Conversation

@knd775

@knd775 knd775 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Runtime scalar variable ids were being saved in the argument_values(document) column, which is a FK for documents(id). By coincidence, this worked most of the time becuase there are typically more documents than runtime scalar variables. However, during HMR the ids were autoincremented, which inevitibly lead to a FK violation when the variable ids didn't happen to match a document id anymore.

Now, the document column correctly holds a document id and FK violations aren't silently dropped anymore.

To help everyone out, please make sure your PR does the following:

  • Update the first line to point to the ticket that this PR fixes
  • Add a message that clearly describes the fix
  • If applicable, add a test that would fail without this fix
  • Make sure the unit and integration tests pass locally with pnpm run tests and cd integration && pnpm run tests
  • Includes a changeset if your fix affects the user with pnpm changeset

The rewrite recorded each runtime scalar as an argument value keyed by
the variable's id, but that column is a foreign key to documents. It only
held while a document happened to share the id, so HMR re-extraction and
parallel loading in houdini generate broke it. Because the FK is
deferred, the violation surfaced at COMMIT and was discarded, rolling
every rewrite back while AfterExtract reported success.

The ncruces backend dropped that commit error too, so the guard never
fired on WASI.
@changeset-bot

changeset-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2999494

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

This PR includes changesets to release 2 packages
Name Type
houdini-core Patch
houdini 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

@knd775 knd775 changed the title fix: Runtime scalars failing validation during HMR fix: Runtime scalars failing validation during HMR and builds Sep 22, 2026
@knd775

knd775 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

I should probably note that this doesn't only affect HMR. It has a chance to break any client generation. In our application, this means about 10% of production builds fail.

@AlecAivazis
AlecAivazis merged commit 6932516 into HoudiniGraphql:main Sep 27, 2026
14 checks passed
@AlecAivazis

Copy link
Copy Markdown
Collaborator

Thanks for fixing this!

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.

2 participants