fix(request): use update_columns:[] on nested target on_conflict (bug-087)#5
Closed
mosoriob wants to merge 1 commit into
Closed
fix(request): use update_columns:[] on nested target on_conflict (bug-087)#5mosoriob wants to merge 1 commit into
mosoriob wants to merge 1 commit into
Conversation
POST /modelconfigurations|/modelconfigurationsetups|/datasetspecifications
with relation fields (hasInput/hasOutput/hasModelCategory/hasPresentation)
returned 400 'null value in column "label"' when the client linked an
existing target by id alone.
buildJunctionInserts emitted update_columns:['label'] on the nested
target-entity insert. With nestedData = {id} only, on Hasura PK conflict
the existing target row got UPDATE label=NULL and tripped the not-null
constraint. Outer junction insert already used update_columns:[]; the
inner inconsistency was the bug.
Switch to update_columns:[] for link-or-noop semantics on existing target
rows. New target rows still insert with all supplied fields. Renames
remain the responsibility of the target's own PUT endpoint.
Tests: updated existing assertion in request.test.ts (Test 1) and added
two regressions covering hasInput as bare-string id and {id}-only object.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Evidence
Reproduction matrix (5 hypotheses, see dynamo-experiment-may/tests/modelconfig_writepaths_results.json):
Test plan
Out of scope
PUT path with a VariablePresentation id still hits configuration_input_input_id_fkey because that FK targets dataset_specification. Separate FK type-mismatch issue; clients must pass DS ids, not VP ids.