Skip to content

fix(retrocompatibility): make test suite pass with sequelize@4.x#761

Merged
romain-gilliotte merged 3 commits into
masterfrom
fix/sequelize-4-support
Jun 28, 2021
Merged

fix(retrocompatibility): make test suite pass with sequelize@4.x#761
romain-gilliotte merged 3 commits into
masterfrom
fix/sequelize-4-support

Conversation

@romain-gilliotte

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

Copy link
Copy Markdown
Contributor

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 }
  ]

@forest-bot

Copy link
Copy Markdown
Member

@romain-gilliotte romain-gilliotte changed the title fix(legacy): work around bugs when using sequelize@4.x fix(retrocompatibility): make test suite pass with sequelize@4.x Jun 24, 2021
@romain-gilliotte romain-gilliotte force-pushed the fix/sequelize-4-support branch from 6872bc0 to 5ff74f8 Compare June 24, 2021 14:30
Romain Gilliotte added 2 commits June 24, 2021 16:39
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
Copy Markdown
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 sequelize@4.x ([#761](#761)) ([a04be5c](a04be5c))
@forest-bot

Copy link
Copy Markdown
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 sequelize@4.x ([#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
Copy Markdown
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