Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mongo): disallow filtered nested disconnect based on inlining #4008

Merged
merged 4 commits into from
May 31, 2023

Conversation

Weakky
Copy link
Member

@Weakky Weakky commented May 31, 2023

Overview

fixes prisma/prisma#16869 (BREAKING)

Please read the issue above to understand the root problem.

Note: We could perform a separate read and then perform the update based on the found ids. Not sure it's worth adding complexity to the graph before we have demand.

@Weakky Weakky requested a review from a team as a code owner May 31, 2023 10:37
Copy link
Contributor

@miguelff miguelff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a question on test coverage, otherwise this looks good based on the issue description. Good job!

enumflags2::make_bitflags!(ConnectorCapability::{#(#required_capabilities|)*}),
enumflags2::make_bitflags!(ConnectorCapability::{#(#required_capabilities)|*}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was this even compiling before?

Comment on lines 183 to 174
if ctx.has_capability(ConnectorCapability::FilteredInlineChildNestedToOneDisconnect)
// If the disconnect happens on the inline side, then we can allow filters
|| parent_field.related_field().is_inlined_on_enclosing_model()
{
types.push(InputType::object(filter_objects::where_object_type(
ctx,
&parent_field.related_model(),
)));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any other test that actually performs the disconnect when there is no need to join on a foreign collection?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The relation link tests that I have modified are inlining the relation on both sides (they generate a bunch of different datamodels)

@tomhoule tomhoule modified the milestone: 4.16.0 May 31, 2023
@Jolg42 Jolg42 added this to the 4.16.0 milestone May 31, 2023
@Weakky Weakky force-pushed the fix/extended-where-disconnect branch from f8a5c40 to 778dee5 Compare May 31, 2023 14:57
@codspeed-hq
Copy link

codspeed-hq bot commented May 31, 2023

CodSpeed Performance Report

Merging #4008 fix/extended-where-disconnect (26da64e) will not alter performances.

Summary

🔥 0 improvements
❌ 0 regressions
✅ 11 untouched benchmarks

🆕 0 new benchmarks
⁉️ 0 dropped benchmarks

@Weakky Weakky merged commit 282e4b4 into main May 31, 2023
51 of 52 checks passed
@Weakky Weakky deleted the fix/extended-where-disconnect branch May 31, 2023 16:45
miguelff added a commit that referenced this pull request Jun 2, 2023
* origin/main:
  qe: fix regression on CreateOne data argument nullability (#4011)
  fix(mongo): disallow filtered nested disconnect based on inlining (#4008)
  nix: make quaint/shell.nix work on darwin (#4013)
  qe: cache resolved QuerySchema input & output object fields (#4009)
  Optimized dual uploads from engineer (#3981)
  qe: remove XML scalar type (#3957)
  qe: make schema building lazy (#3977)
  introspection: fix reintrospection of @default(uuid()) @db.Uuid (#4004)
  build(deps): bump h2 from 0.3.15 to 0.3.17 (#3872)
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.

Nested disconnect fails on MongoDB with extendedWhereUnique
4 participants