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

Some databaseOptions that are valid MongoDB options are marked as invalid #9523

Open
pocketcolin opened this issue Jan 9, 2025 · 4 comments · May be fixed by #9522
Open

Some databaseOptions that are valid MongoDB options are marked as invalid #9523

pocketcolin opened this issue Jan 9, 2025 · 4 comments · May be fixed by #9522

Comments

@pocketcolin
Copy link

New Issue Checklist

Issue Description

I'm pretty much just adding onto issue #9211 with this issue and already have a PR to address it. There are lots of Mongo config options, but because Parse 7 now validates server config keys we now need to hardcode those options so they pass validation.

Steps to reproduce

const config = {
  ...,
  databaseOptions: {
    connectTimeoutMS: 1000,
    socketTimeoutMS: 1000,
    minPoolSize: 10,
  }
}

Actual Outcome

Error logged:

error: Invalid Option Keys Found: databaseOptions.connectTimeoutMS, databaseOptions.socketTimeoutMS, databaseOptions.minPoolSize

Expected Outcome

No error logged, as these are all valid keys.

Environment

Server

  • Parse Server version: 7.4.0
Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@pocketcolin pocketcolin linked a pull request Jan 9, 2025 that will close this issue
1 task
@mtrezza
Copy link
Member

mtrezza commented Jan 9, 2025

What's your suggestion? That we remove the validation completely?

I don't see much purpose in validating the DB options, as they are not exposed and the MongoDB driver would throw an error anyway. Just instead of the driver throwing the error, Parse Server throws it beforehand. Doesn't seem necessary, and only keeps the burden of maintaining the options list, which probably doesn't make much sense anyway since the options may change depending on the MongoDB (driver) version and we don't consider that in the validation.

Edit: re-reading #9211 I remember why validation wasn't removed, as some Parse Server options are hidden in the MongoDB driver options. Now would be a good time to consider separating these custom option from MongoDB native options, and then remove validation all together.

@pocketcolin
Copy link
Author

@mtrezza yeah sorry I removed my previous comment because I re-read #9211 and understood why you made that decision orignally. I would completely agree that in an ideal world we'd have a separate config for mongo connection settings that wasn't intermixed with parse server config and then we could remove mongo config validation altogether. I doubt that's something I'd have time for in the near future, but I'm happy to look at it when I have time.

@mtrezza
Copy link
Member

mtrezza commented Jan 10, 2025

Let's see, we'll take a look; if it's more work we can just add the option for now and merge your PR.

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 a pull request may close this issue.

2 participants