Skip to content

test: cover has-many deleteAll bindings - #352

Open
elpete wants to merge 1 commit into
nextfrom
issue/124
Open

test: cover has-many deleteAll bindings#352
elpete wants to merge 1 commit into
nextfrom
issue/124

Conversation

@elpete

@elpete elpete commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Refs #124

Issue review

Fit score: 9/10. Relationship deleteAll() must bind the parent foreign-key value correctly. Substituting a boolean can delete the wrong rows or fail at the database boundary, so this behavior warrants a permanent integration regression.

Reasons for

  • protects a destructive operation from incorrect bindings
  • exercises the normal Quick relationship API and real database effects
  • verifies unrelated parents are not affected

Reasons against

  • the original report depended on older Quick/qb versions and specific entity metadata that is no longer available
  • application-level cascades remain preferable when no per-child business logic is needed

Attempted reproduction

I reproduced the reported shape with a loaded User, its hasMany( Post ) relationship, and user.posts().deleteAll() on current next with qb 14.0.0-beta.3. The bug did not reproduce: only rows bound to user ID 1 were deleted, and another user’s posts remained. No production change was needed, so this PR adds the public-API regression that proves the current behavior.

Validation

  • focused HasManySpec: 14 passed, 0 failed, 0 errors
  • full suite: 496 passed, 0 failed, 0 errors, 3 skipped
  • box run-script format
  • git diff --check
  • qb dependency: 14.0.0-beta.3

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.

1 participant