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(retrocompatibility): make test suite pass with [email protected] #761

Merged
merged 3 commits into from
Jun 28, 2021

Conversation

romain-gilliotte
Copy link
Contributor

@romain-gilliotte romain-gilliotte commented Jun 24, 2021

Fix retrocompatibility with sequelize 4.

The issue in the ticket is due to the fact than in Sequelize 4, it is illegal to join the same relation twice.
This happens in smart field cutom search, when customers inject "include" into the query options

{
  // illegal in sequelize@4, OK in sequelize@5 and 6
  include: [
     { as: 'something', model: Something },
     { as: 'something', model: Something }
  ]

@romain-gilliotte romain-gilliotte changed the title fix(legacy): work around bugs when using [email protected] fix(retrocompatibility): make test suite pass with [email protected] Jun 24, 2021
Comment on lines +51 to +58
if (include.sequelize) {
return {
model: include,
as: Object
.keys(model.associations)
.find((association) => model.associations[association].target.name === include.name),
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

[MISC] I don't get the usage solved here 🤔

@romain-gilliotte romain-gilliotte merged commit a04be5c into master Jun 28, 2021
@romain-gilliotte romain-gilliotte deleted the fix/sequelize-4-support branch June 28, 2021 14:06
forest-bot added a commit that referenced this pull request Jun 28, 2021
## [7.11.4](v7.11.3...v7.11.4) (2021-06-28)

### Bug Fixes

* **retrocompatibility:** make test suite pass with [email protected] ([#761](#761)) ([a04be5c](a04be5c))
@forest-bot
Copy link
Member

🎉 This PR is included in version 7.11.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

forest-bot added a commit that referenced this pull request Jul 6, 2021
# [8.0.0-beta.9](v8.0.0-beta.8...v8.0.0-beta.9) (2021-07-06)

### Bug Fixes

* fix types ([580ef41](580ef41))
* support inverseOf property ([#760](#760)) ([6fab976](6fab976))
* **authentication:** error during authentication when the environment is secret passed as a liana option and not an environment variable ([#758](#758)) ([39ab674](39ab674))
* **intercom:** fix date conversion from unix timestamp to js date of intercom attributes ([#754](#754)) ([11a1549](11a1549))
* **retrocompatibility:** make test suite pass with [email protected] ([#761](#761)) ([a04be5c](a04be5c))
* fix mssql ordering collection by pk ([#734](#734)) ([7bbd19d](7bbd19d))
* prevent IP check from failing for the proxies including the port in the headers ([#751](#751)) ([92852f7](92852f7))

### Features

* add typescript declaration file ([#743](#743)) ([a536f1c](a536f1c))
* include role in the user data inside the request ([#746](#746)) ([425bba5](425bba5))
@forest-bot
Copy link
Member

🎉 This PR is included in version 8.0.0-beta.9 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants