get-convex / get-convex/convex-js

Convex function metadata extraction can silently produce incomplete validators when `args`/`returns` reference a runtime import involved in an import cycle

Open
#175 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
366
Forks
109
PR merge metrics
No merged PRs in 30d

Description

Using Convex 1.42.0, I had a mutation like:

```ts
export const foo = mutation({
args: {
...someSharedArgs,
},
handler: ...
});
```
`someSharedArgs` was imported from another Convex module that also imported runtime values from the mutation module, creating a cycle. convex deploy succeeded, but production function
metadata/runtime validation didn't include any of the fields in `someSharedArgs`.

Expected behavior: Convex codegen/deploy/function-spec should fail closed with a diagnostic for cyclic or unresolvable function metadata, or otherwise guarantee the extracted validator is complete.

Actual behavior: deploy succeeded with partial/stale metadata, causing a production runtime validator mismatch.

Even if application-level circular imports are discouraged, silently deploying incomplete function metadata seems like a codegen/deploy defect. A hard error pointing at the cyclic metadata dependency
would have prevented the regression.

Contributor guide

Open the contributing guide

Research direction

Start by tracing Convex codegen, deploy, and function-spec metadata extraction for args and returns that reference runtime imports, then reproduce the cyclic-module case described here. Done means cyclic or unresolvable metadata produces a diagnostic, or extraction guarantees a complete validator; add a regression test for the incomplete-validator scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.