Skip to content

Pipeline Graph: Fix query length bug

Sarah Groff Hennigh-Palermo requested to merge 329895-quick-length-fix into master

What does this MR do?

This is a medium-term fix for the problem outlined in #329895 (closed). In short, we use eTag caching for the pipeline graph, which means we have to use GET requests, which means the whole query goes into the URL. Apollo Client pretty-prints the queries that go into the URL and adds a bunch of whitespace, which we can’t control. It’s fine on our SaaS stack, but some self-hosted clients have a layer in the stack that rejects the length.

Although we looked into breaking up the queries, the minimal query is still too long — anything shorter and we’d be polling only segments, which could lead to weird inconsistency problems. We can’t delete the old graph till this is fixed.

And so, here we use a custom fetch function when the Apollo Link uses GET. (We already have to use a different link library.) This function removes all instances of multiple spaces and newlines in the query parameter, taking a test query from over 4000 characters to ~1400. Queries under 2000 characters are considered "safe".

While this is a less-than-ideal solution, it will unblock progress until subscriptions are ready (#332485) or another more-robust solution, such as query compression are implemented. (Continuing discussion will take place or be linked in #329895 (closed).) But we will be able to address the bug in %14.1!

Screenshots or Screencasts (strongly suggested)

before after
Screen_Shot_2021-07-06_at_17.36.07 Screen_Shot_2021-07-06_at_17.29.18

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #329895 (closed)

Edited by Sarah Groff Hennigh-Palermo

Merge request reports