-
Notifications
You must be signed in to change notification settings - Fork 21
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
Timeout upon saving a new document #74
Comments
Sounds strange. Can you provide a simplified example repository that allows to reproduce this and versioning information for everything that's not versioned through your repo like mongodb itself? |
Hey @hk7math, |
I remake an example repo for my case.
I tried downgrading mongoose version with the following
Thank you very much! |
For reference, it seems other people encounter similar error on Mongoose Repo |
I can say that the issue discussed here is somehow related to the saving of the patch. In I may have time this evening to do some further debugging. However I don't know if this is related to the mongoose issue you pointed at, since this is relatively new and our issue arises even with older versions of mongoose. This may be related to how the mongoose connection is defined or how Thanks for adding additional info @hk7math! |
SummaryThe timeout error origins in an undefined mongoose connection for our Quick workaround: Change DetailsBackground KnowledgeThe Usually one just imports/requires the
Specific errorIn your sample repo you pass the default imported mongoose instance as done in our usage example. This default mongoose instance however has no connection assigned to it, since the connection is created with Mongoose.createConnection. Since a new connection is added, the default connection (connections[0]) is still uninitialized. Hence our plugin has no connection to work with. Solutions
@codepunkt I think a PR is needed where the connection state is examined before each patch operation. If the connection is not in state I'd of course volunteer to tackle this but only if you have the time to review and merge the PR, or else we are talking about the maintainer role again. |
@vinerich Thank you so much! I have updated the |
I'm new to document versioning and have been trialing on a few similar plugins. It may be my mis-configuration, but I have really no idea what's going wrong after attempting for a whole day...
When I comment out the plugin-related script, Mongoose works as expected. But if the plugin is applied, new document cannot be saved and results in timeout...
Below is my
models/issue.js
.Versions:
node: 12.18.4
mongodb: 4.2.11
mongoose: 5.11.4
mongoose-patch-history: 2.0.0
Appreciate any help. Thank you!
The text was updated successfully, but these errors were encountered: