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

Database options connect fix #8470

Conversation

omairvaiyani
Copy link
Contributor

@omairvaiyani omairvaiyani commented Mar 8, 2023

Closes: #8466

A new set of Parse Config options were added in v6 to databaseOptions called enableSchemaHooks and schemaCacheTtl. However, these options are not strictly speaking database options, they instead manage Parse's internal behaviour with relation to the database. This means that MongoDB doesn't recognise these options and so, they must not be passed into the MongoDB client constructor.

This was correctly handled in the MongoStorageAdapter where the new, non-mongodb options are deleted - Screenshot 1 before they're used as MongoDB client options.

However, there remains another area where the unsupported options are passed to a MongoDB client. You can see in Screenshot 2 that _mongoOptions is used directly when connecting to the MongoDB client in the GridFSBucketAdapter.
This is where an error is thrown (screenshots 3 and 4) if a Parse Server uses the new enableSchemaHooks or schemaCacheTtl options.

Screenshot 1
image

Screenshot 2
image

Screenshot 3
image

Screenshot 4
image

@parse-github-assistant
Copy link

parse-github-assistant bot commented Mar 8, 2023

Thanks for opening this pull request!

@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Patch coverage: 35.00% and project coverage change: -0.35 ⚠️

Comparison is base (4ce135a) 94.30% compared to head (86246d9) 93.96%.

❗ Current head 86246d9 differs from pull request most recent head 9c622ef. Consider uploading reports for the commit 9c622ef to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #8470      +/-   ##
==========================================
- Coverage   94.30%   93.96%   -0.35%     
==========================================
  Files         183      183              
  Lines       14484    14504      +20     
==========================================
- Hits        13659    13628      -31     
- Misses        825      876      +51     
Impacted Files Coverage Δ
src/Options/Definitions.js 100.00% <ø> (ø)
src/Options/index.js 100.00% <ø> (ø)
src/middlewares.js 92.64% <23.52%> (-4.17%) ⬇️
src/Adapters/Files/GridFSBucketAdapter.js 93.61% <100.00%> (+0.13%) ⬆️
src/Adapters/Cache/RedisCacheAdapter.js 17.39% <0.00%> (-73.92%) ⬇️
src/LiveQuery/ParseCloudCodePublisher.js 84.21% <0.00%> (-15.79%) ⬇️
src/ParseServer.js 92.20% <0.00%> (-0.44%) ⬇️
src/LiveQuery/ParseLiveQueryServer.js 95.78% <0.00%> (-0.22%) ⬇️
src/RestWrite.js 94.91% <0.00%> (+0.14%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dblythy
Copy link
Member

dblythy commented Jun 19, 2023

Closed via #8467

@dblythy dblythy closed this Jun 19, 2023
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 this pull request may close these issues.

GridFS fails with enableSchemaHooks is not supported
2 participants