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

Fix unscoped when using postgres and raw queries #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ariwbolton
Copy link

Should fix #4.

This change should be non-controversial: _.isMatch(object, source) is equivalent to _.matches(source)(object), but _.isMatch doesn't deep clone the source.

I've updated a test to "cover" this (in the hopes that perhaps eventually it'll be valuable), but unfortunately we'd need unit tests against postgres, too, instead of just sqlite, to confirm that this issue isn't occurring. Note that the test wouldn't fail if the issue exists, it would simply log an error and succeed anyways. (In the project I'm working on, this issue only seems to cause tests to fail when many concurrent connections are already open, and with many tests being run. I don't know what the exact problem is, but I'm not sure it's worth it to spend a bunch of time trying to design a more effective test; this should at least log an error when it's occurring)

That said, I've manually tested against another project which does use postgres, and it seems the issue has disappeared with this change (and generally that unscoping works as before).

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.

Unscoping raw queries can spawn new connections
1 participant