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

Weird ProtocolEncodingError in Rust #303

Open
jollygreenlaser opened this issue Mar 22, 2024 · 0 comments
Open

Weird ProtocolEncodingError in Rust #303

jollygreenlaser opened this issue Mar 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jollygreenlaser
Copy link

  • EdgeDB Version: EdgeDB Version: 4.4+596d0e4 on Ubuntu 22.04.3 LTS
  • EdgeDB CLI Version: EdgeDB CLI 4.1.0+a8fe4d7

I have a query that works fine in UI and CLI but dies in code (Rust) with ProtocolEncodingError which seems relatively rare.

It's a query selecting one of two options of an abstract type, with the same struct in rust. The query was working fine with both types using multi hop links in filters, but I refactored it after my discovery that subqueries were more performant. (see: https://discord.com/channels/841451783728529451/1220216804052308028)

After the refactor - same shape for the output, just a different way to filter for the object - I got the ProtocolEncodingError on one of the two types. The other works fine.

I narrowed it down to one computed field causing the issue. It looked something like:

is_done := assert_single(([is ThingA].subset.done ?? false) or
            ([is ThingA].subset.group.status ?? [is ThingB].group.status) = Status.Complete),

Where group is the same type on both, just from different levels of linkage.

What was super weird - beyond this error only happening in code and not UI/CLI, and only on one of the two types - is that the error would go away with almost any removal from that statement. I could remove almost any of the conditions that create that boolean and it would stop throwing the error.

is_done := assert_single(([is ThingA].subset.done ?? false) or
            ([is ThingA].subset ?? [is ThingB]).group.status = Status.Complete),

This is what I switched to so that I could retain the same logic but not hit the error. Super unclear why this mattered. Curious if others have encountered this or how to avoid hitting it. Nightmare to debug.

@raddevon raddevon transferred this issue from edgedb/edgedb Mar 25, 2024
@raddevon raddevon added the bug Something isn't working label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants