Skip to content

fix: take scope into account when setting associated models with belongsToMany's .setX - #14738

Merged
ephys merged 5 commits into
mainfrom
ephys/fix-flakiness
Jul 11, 2022
Merged

ephys merged 5 commits into
mainfrom
ephys/fix-flakiness

Conversation

@ephys

@ephys ephys commented Jul 10, 2022

Copy link
Copy Markdown
Member

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • Does yarn test or yarn test-DIALECT pass with this change (including linting)?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description Of Change

I found the source of the flakiness of one of our recurrent flaky tests

The belongsToMany tags and categories associations between Post & Tag used the same through table, and were differentiated by a scope set on the target model (Tag)

setCategories and setTags were not taking the target model's scope into account when removing existing associations. This is now fixed.

@ephys
ephys requested a review from a team July 10, 2022 12:37
@ephys ephys self-assigned this Jul 10, 2022
@ephys ephys added the type: bug DEPRECATED: replace with the "bug" issue type label Jul 10, 2022
@ephys ephys mentioned this pull request Jul 10, 2022

@WikiRik WikiRik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just noticed this comment which we can remove now

@ephys ephys changed the title fix: fix belongsToMany .setX association method ignoring scope fix: take scope into account when setting associated models with belongsToMany's .setX Jul 11, 2022
@ephys
ephys merged commit d7a501a into main Jul 11, 2022
@ephys
ephys deleted the ephys/fix-flakiness branch July 11, 2022 11:41
@github-actions

github-actions Bot commented Aug 7, 2022

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 7.0.0-alpha.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released on @v7 type: bug DEPRECATED: replace with the "bug" issue type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants