-
Notifications
You must be signed in to change notification settings - Fork 256
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
Flux builder doesn't show results in firefox #4030
Comments
For whoever picks this up, the runtime error originates here: chronograf/ui/src/flux/apis/index.ts Line 123 in 82910aa
The issue is that We need some other way of reading partial responses from the Flux proxy. We can't read the entire response and then truncate it, since the response could be huge (gigabytes). As far as I know, the |
After spiking on this, TLDR of my findings is that I agree with @chnn that this work should be done on the backend, until the Streams API is sufficiently implemented in all browser vendors that we wish to support. One solution could be something like a paging API that clients would consume. This would make this feature consistent and uniform across all browser vendors in the UI/Chronograf, as well as for other consumers of the platform API going forward. Moving this work to the server would require a refactor of the current code by which we consume responses to Flux queries from the UI/Chronograf, as it consumes the Non-TLDR:
The essential reason for not trying to solve this in the client is that various browser vendors have varying and inconsistent support for streaming, whether via implementation of the W3C ratified Streams API spec (https://www.w3.org/TR/streams-api/) or via the XHR (XMLHttpRequest) API. The Streams API has been implemented in Chrome and Edge fully, it has not been fully implemented in Firefox or Internet Explorer, and unknown in Safari: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API. The issue at hand here is a case in point, where XHR is implemented in all browsers, but wasn't really built for streaming: https://hpbn.co/xmlhttprequest/. Here's how XHR can be used for "streaming", but it doesn't work in all browsers: https://gist.github.com/igrigorik/5736866. While some vendors engineered a way to make it work for "streaming" (what is known as "chunked transfer"), Firefox and Internet Explorer both would require their own custom Moreover, as for user-agent detection in case we even wanted to try to solve this problem with any of the XHR line of inquiry above, we'd have to detect or infer the client somehow to get it right per browser: https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Feature_detection. I was able to detect that Body.body is not implemented via the following, but this wouldn't help us know which user-agent was our client:
User-agent sniffing is discouraged for being notoriously fickle and inaccurate. Due to the limitations of XHR, our AJAX library So this is all to say, let's solve this in the server until the Streams API is implemented sufficiently in all browser vendors that we wish to support. |
Blocked on stabilization of platform so that we can solve this on the server side. |
From Slack discussion between me + @jaredscheib :
|
Thanks, @lukevmorris! I did forget to mention that we'd discussed adding Whether via |
let's set up a meeting to discuss options. |
Using nightlies from July 26th. Verified to work correctly in Chrome. Screenshots attached showing that
csv
results where received .. and some javascript errors that seem related.The text was updated successfully, but these errors were encountered: