-
Notifications
You must be signed in to change notification settings - Fork 26
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
Handle server v4.3 changes in answering UPDATE query #289
Conversation
Sorry, it includes many changes in coding style, just because my editor (Helix) runs Rustfmt automatically. |
Thanks for the PR! I think this looks good, nice comments to show what's being done at each step and why. So looks like the changes are impl PartialEq for ObjectShapeInfo (for the ensure! macro on line 678) and doing the mapping inside fn encode, everything else is coding style. On that note, there are some files that don't work well with rustfmt but looks good for this one. Line 711 could be a bit more readable as something like this:
And I would change Also I see the change adds a dependency to edgedb-protocol which has very few of them but log is so incredibly small that I think it's fine to add it here. I'll ping @fantix to get a second opinion just in case! P.S. The context is that this trick doesn't work anymore after 4.3: https://quan.hoabinh.vn/post/2023/08/querying-edgedb-with-name-parameters-in-rust |
Thank you, @Dhghomon, I updated as per your suggestion. |
Thanks for the PR! Overall, I don't think sorting the codecs/fields per object is
Is there a reference PR/issue that elaborates on this change? Or could you please provide an example (schema + query) of how you get a
Please kindly put the reformatting changes in a separate commit. |
This issue is found out by me, so this PR is the first place it is reported. |
Yes, still the list, but it is not the problem. The problem is the order of elements in that list, which server responded. Whether it is server bug or not, it is by design. Normally, in other languages (Python, JS), the order of object/dictionary fields doesn't matter, so even when server responds with swapped order, the clients in those languages are still fine.
Yes, if the Rust client have another way to encode the
If you approve the approach of this PR, I will recreate another PR with those coding style changes stripped. |
Actually, the underneath object fields/elements in EdgeDB are, by design, a stable list (this is crucial for the protocol/type descriptors), not a PL-ish order-free dictionary (btw recent Python
Could you point me to a more specific query in your repo that stopped working? |
Every I've just remembered that I created a small internal tool, to debug the issue, where I issue an |
OK, I can confirm that in 4.3 the server started listing those parameters in a different order, though I haven't tested anything with edgedb-rust. The CLI will prompt for them in the reverse order.
was the query |
Ok. I close this PR and wait for the fix from server. |
I don't think the server is doing anything wrong |
Oh, so which side should be fixed? The server or this Rust client? |
Probably the Rust client, though we still need to reproduce a failure. |
I will introduce EdgeDB in a FOSS conference, FOSSASIA Summit 2024. I hope this bug be addressed soon. |
A minimal reproducible example would go a long way towards getting this fixed. |
I can confirm #298 is fixed by this PR. |
Should be fixed with #304 |
In v4.3, when we execute
UPDATE
query with named parameters (passed viaValue::Object
), the server answersCommandDataDescription
with different order of object fields, that makes our client failed withMismatchObjectShape
.This PR is to let the client flexible with that.