Skip to content

Fix JiT assertion compilation to accept object result shape#2221

Merged
rafal-hawrylak merged 1 commit into
mainfrom
fix-jit-assertion-object-shape
Jul 15, 2026
Merged

Fix JiT assertion compilation to accept object result shape#2221
rafal-hawrylak merged 1 commit into
mainfrom
fix-jit-assertion-object-shape

Conversation

@rafal-hawrylak

Copy link
Copy Markdown
Collaborator

Assertion JiT code returning an object (rather than a bare string) had the whole object stored into JitAssertionResult.query — a string field — producing broken read-back and downstream encoding errors.

Mirror makeJitTableResult: unwrap .query from an object, keep the bare-string path unchanged. Widen JitAssertionResult to string | { query: string } to match.

Regression tests cover the bare-object shape and an object with additional (ignored) fields.

Integration of JiT assertions will come in new PR after #2211 lands.

@rafal-hawrylak
rafal-hawrylak requested a review from a team as a code owner July 15, 2026 11:56
@rafal-hawrylak
rafal-hawrylak requested review from apilaskowski, ikholopov-omni and udim and removed request for a team and udim July 15, 2026 11:56
Comment thread core/jit_compiler.ts Outdated
Assertion JiT code returning an object (rather than a bare string)
had the whole object stored into JitAssertionResult.query — a string
field — producing broken read-back and downstream encoding errors.

Coerce the result inline: string → { query }, object passes through.
Widen JitAssertionResult to `string | { query: string }` to match.

Regression tests cover the bare-object shape and an object with
additional (ignored) fields.
@rafal-hawrylak
rafal-hawrylak force-pushed the fix-jit-assertion-object-shape branch from 6cfdd04 to 02f3d62 Compare July 15, 2026 12:06
@rafal-hawrylak
rafal-hawrylak merged commit ac09895 into main Jul 15, 2026
11 checks passed
@rafal-hawrylak
rafal-hawrylak deleted the fix-jit-assertion-object-shape branch July 15, 2026 14:02
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.

3 participants