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

Known Issue: Instances where mongoose-unique-validator package causes incorrect error thrown involving _id must be unique error #272

Open
JonathanLeeWH opened this issue Oct 28, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@JonathanLeeWH
Copy link
Contributor

JonathanLeeWH commented Oct 28, 2021

Known Issue:

Instances where mongoose-unique-validator npm package causes incorrect error thrown involving _id must be unique error. It is an ongoing issue in mongoose-unique-validator npm package.

Affects

It affects frontend integration where bad requests status code 400 would be shown for adding or editing software as it will shown software as not added successfully.

Potential Workaround:

  • To remove the mongoose-unique-validator plugin entirely and check the error code thrown by mongoose manually.
    or
  • To wait for a bug fix in mongoose-unique-validator plugin.

The stopgap measure:

Related Issue:

mongoose-unique-validator GitHub

GitHub Issue 1
GitHub Issue 2

@JonathanLeeWH JonathanLeeWH pinned this issue Oct 28, 2021
@JonathanLeeWH JonathanLeeWH added the bug Something isn't working label Oct 28, 2021
@JonathanLeeWH
Copy link
Contributor Author

JonathanLeeWH commented Dec 24, 2021

  • Temporary Solution: mongoose-unique-validator downgraded to last working version 2.0.3 with npm install [email protected] --legacy-peer-deps
  • Temporary added --legacy-peer-deps flag to npm install in Dockerfile and Dockerfile-ci to support the downgraded mongoose-unique-validator 2.0.3

JonathanLeeWH added a commit that referenced this issue Dec 24, 2021
…-validator-downgraded

Temporary Solution to Issue #272: `mongoose-unique-validator` downgraded to `2.0.3`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant