-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Reporting] CSV report contents are incorrectly encoded to base64 #202580
Comments
Pinging @elastic/appex-sharedux (Team:SharedUX) |
Does this mean there could be new csv reports in base64 and old that are not encoded? Do we have a download code path that can handle both in the same time? |
@paulinashakirova I just noticed this line:
I would see if the problem is fixed by changing that declaration to use - jobContentEncoding = 'base64' as const;
+ jobContentEncoding = 'csv' as const; |
Yes, there could be new reports that are encoded in base64 and old reports that are not. I did some extra testing and found this problem started in 8.10.0. Fortunately, I am able to download a report created in 8.9 (not encoded in base64) when running 8.10 (expects base64). I think there is some magic happening here - maybe Chrome is "un-encoding" the content? I have found that my above suggestion does fix the issue, but now when we download a report that was created in 8.10-8.16, the raw data sent to the client is base64 text. This gets automatically decoded to plain CSV, at least in my testing in Chrome browser. The only things I could see that may give us trouble:
To address the first concern, maybe we should make the fix a 9.0-only change, and add documentation to the release notes that there is possibly a known issue? Can you think of any more tests we may want to run first? |
Hm, doesn't seem to be working for me. When I try to download old raw report that is decoded as base64, I see:
I don't see it, when I download such report I get a raw base64 file, this is what I see the base64 when try to open it: This is how I was testing:
So encoding/decoding doesn't seem to be working when params are different in any direction To make the change safe now, maybe we could change to |
Something like this will work. Keep in mind we also have a
|
Out of curiosity, I have tracked down the PR that introduced this. The version was 8.10 |
Problem: Recently, I noticed that Reporting is encoding CSV file contents to base64. This does not occur in earlier version of Kibana, and should not be happening.
Reporting was designed to encode report contents to base64, but should be doing so only when the content type is binary, such as PDF/PNG.
The text was updated successfully, but these errors were encountered: