-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix mishandling of GeoJSON inputs in subscriptions (fix #3239) #3344
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 mishandling of GeoJSON inputs in subscriptions (fix #3239) #3344
Conversation
|
Deploy preview for hasura-docs ready! Built with commit 99c0bde |
|
Review app for commit 7bfdb15 deployed to Heroku: https://hge-ci-pull-3344.herokuapp.com |
7bfdb15 to
347d65e
Compare
|
Review app for commit 347d65e deployed to Heroku: https://hge-ci-pull-3344.herokuapp.com |
347d65e to
dbbc3a0
Compare
|
Review app for commit dbbc3a0 deployed to Heroku: https://hge-ci-pull-3344.herokuapp.com |
This makes sense. Thank you.
I think we should hide this extra power/non-compliance behind a flag so that our users don't rely on this feature. Regarding the query generation logic for supporting multiple fields, I wanted to check Postgres's plan for these two statements: select json_build_object('alias1', (query1), 'alias2', (query2))vs the current implementation in the PR select json_build_object('alias1', q1.root, 'alias2', q2.root)
from query1 as q1, query2 as q2For example in this subscription: subscription s {
actors {
id
}
artists {
id
}
}Postgres's plans are the following: From what I could briefly experiment, I couldn't see any practical difference, even though the second plan has a 'Nested Loop' in its plan as |
dbbc3a0 to
99c0bde
Compare
|
Hello, is there any news? |
|
The comment I wrote in #3239 (comment) still applies. As I said there:
Volunteers welcome. |
|
Would love whatever pointers you have so we can see if we can help get this in faster, @lexi-lambda |
|
Hi, @24601. If you want to take this up yourself, I should warn you that it will involve writing a little Haskell. 🙂 If that doesn’t daunt you, you should start with the server CONTRIBUTING.md file, which describes how to get a build environment set up. |
|
So Haskell and getting the build env set up isn't the part that I'm worried about inasmuch as what actual Hasura-codebase and process specific items there are and getting my head around them so I can decide if the time & risk is worth it for our devs and/or me to take this on. We really want and need it but the workaround is currently to just use watchQuery on the client side in apollo, so it's not a sev 1, but it's definitely suboptimal. I need to be able to weigh the pain of that (and maintaining workarounds like this in our client code as well as the inefficiency on the client and server load side of constant watchQuery polls) vs the work items left here. I can assign a cost/sizing to getting some Haskell know-how (either my own or a dev's) on the project and some time to getting a build env set up, can you shed some light on what tasks remain on the code side and getting the PR to the point that it would acceptable to the reviewers to actually merge so I can make this cost-benefit decision with those Hasura-specific code & process items as a little bit less of a blackbox? Right now I'd just be guessing and it's feels like a rabbit hole I'd be throwing a hapless dev into, but if I have an idea of how deep it might go because someone with a bit more insight can at least tell me the higher level task list, I could do this with a bit more confidence. If that just isn't knowable yet, I totally get it. But it sounds like from this thread we know what needs to be done, it's just about assigning the time & energy to it.
|
|
@24601 We'll start working on this today. Unfortunately it has longer than expected to get to this issue. Notes for @abooij : |
|
@0x777 - Thanks, I fully understand how that goes! And we’re more than happy to contribute and be active participants in the community, just want to have some understanding of where and how we get involved so our contributions are in areas that benefit others and ourselves mutually the most. If I had to choose between doing this or getting a to_tsquery and @@ operator implemented natively without having to resort to actions or exposing functions so it’s a first-order citizen, I know which I’d decide to put our development resources towards. Thanks for keeping this in-mind, we’re willing to help however we can.
|
|
Superseded by #4551 |
|
Review app https://hge-ci-pull-3344.herokuapp.com is deleted |
Description
This PR fixes #3239, which was caused by an oversight in the way we generate multiplexed queries. The actual fix is minuscule, so most of the change set is to support the tests. More details below.
Affected components
Related Issues
#3239
Solution and Design
One of the reasons it’s easy for these bugs to happen is that our test coverage of subscriptions is fairly poor. It would be silly to duplicate all of our existing query tests just to test subscriptions (and because it’s an unreasonable amount of effort, those tests never get written). Therefore, this PR adds a new transport option to the pytest test suite that allows query tests to be executed as if they were subscriptions.
The only problem with this is that the GraphQL spec disallows multiple root fields in a single subscription, which means tons of queries are rejected just because of that artificial limitation. Therefore, this PR removes it, but that technically means we are not in full compliance with the GraphQL spec.
One solution to this dilemma would be to hide our noncompliant support for multiple root fields in subscriptions behind a command-line flag that we can enable during testing. I think that’s a good compromise, but I’ll let other people weigh in before I make that call.
Server checklist
Catalog upgrade
Does this PR change Hasura Catalog version?
Metadata
Does this PR add a new Metadata feature?
GraphQL
Breaking changes
Steps to test and verify
This fix is exercised by the automated test suite.