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

update live query client #131

Merged
merged 6 commits into from
Nov 21, 2023

Conversation

avalanche123
Copy link
Collaborator

Description of your changes

In order to minimize patches, I've added ability to disable apollo tracing extension,
which drammatically shrinks patch responses. Additionally, the previous implementation
suffered from inconsistent throttling because between producing graphql response
marshaller and it actually marshalling into output, there could be a non-trivial
delay due to all fields getting resolved during marshalling. Finally, the original
implementation would swallow context errors, since there is no way to add errors to
streaming responses channel.

With this implementation, we don't generate liveQuery resolver, relying on a gqlgen
operation interceptor extension. When an operation is detected to be a liveQuery
subscription field, it is replaced with a query equivalent and the handler re-runs
the query in a loop with throttle backoff.

  • allow disabling apollo tracing extension
  • consistently sort events in responses
  • rework live queries implementation

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

Tested locally.

@avalanche123 avalanche123 force-pushed the update-live-query-client branch 17 times, most recently from 6b12157 to eda70d1 Compare November 12, 2023 00:03
internal/cache/live_query.go Outdated Show resolved Hide resolved
@avalanche123 avalanche123 force-pushed the update-live-query-client branch from 5069478 to 9bae53d Compare November 12, 2023 19:10
@AlainRoy
Copy link

which dramatically shrinks patch responses

I'm curious -- can you add some rough estimates on how much it's reduced?

@avalanche123
Copy link
Collaborator Author

@AlainRoy sure, there you go:
old:
image

new:
image

@avalanche123 avalanche123 self-assigned this Nov 13, 2023
Signed-off-by: Bulat Shakirzyanov <[email protected]>
Signed-off-by: Bulat Shakirzyanov <[email protected]>
Signed-off-by: Bulat Shakirzyanov <[email protected]>
Signed-off-by: Bulat Shakirzyanov <[email protected]>
Signed-off-by: Bulat Shakirzyanov <[email protected]>
@avalanche123 avalanche123 force-pushed the update-live-query-client branch from 0e77ae7 to 1eac739 Compare November 21, 2023 19:10
@avalanche123 avalanche123 merged commit 4f7bacb into upbound:main Nov 21, 2023
6 of 7 checks passed
@avalanche123 avalanche123 deleted the update-live-query-client branch November 21, 2023 19:22
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.

4 participants