Page MenuHomePhabricator

Get rid of this ?download=true parameter
Closed, ResolvedPublic

Description

Hi. See for example the result of 27365:

image.png (791×1 px, 53 KB)

Thank you.

Event Timeline

Please always include steps to reproduce in bug reports.

I do not see what to write here, but here you are:

  1. Run 27365.
  2. Check html output.

Clear steps with links, so people don't have to find out themselves (I guess that's https://quarry.wmflabs.org/query/27365 now that I've taken a look at Quarry), browser information and browser version information (as needed in basically every bug report, as I cannot reproduce any problem).

I understand your problem. Usually it's OK. But now the bug report goes to one particular person, that know all that. Here is your link: https://quarry.wmflabs.org/run/290198/output/0/html?download=true.

N3: About you asked: Last Quantum on Windows 7.

View > Text Encoding > Unicode.

The file is UTF-8 encoded.

Hi, @zhuyifei1999, and thank you. Could you please add an explanation somewhere in the output?

I understand your problem. Usually it's OK. But now the bug report goes to one particular person, that know all that.

@IKhitron: No, nobody else knows which browser you use and which exact steps you performed, and it's often enough that some "particular person" cannot reproduce. Please provide good and complete bug reports by always providing 1) clear steps to reproduce including links, 2) actual outcome, 3) expected outcome.

N3: About you asked: Last Quantum on Windows 7.

For future reference, please provide exact version information. "Last" means nothing (ESR? stable? nightly? aurora?) and "Quantum" is probably Firefox?

Could you please add an explanation somewhere in the output?

Well, why?

The HTML file itself is okay. If you open it with a random Unicode text editor it'll show up correctly. It's Firefox's fault at not using UTF-8 by default. Also, the response of https://quarry.wmflabs.org/run/290198/output/0/html?download=true has a clear indication of UTF-8 (Content-Type: text/html; charset=utf-8)

Honestly, I would prefer just get rid if this ?download=true and leave the url as https://quarry.wmflabs.org/run/290198/output/0/html, which works fine despite having the exact same binary contents. @Framawiki opinions?

Proposing to decline this task as this seems to be either a local Firefox setting to overwrite the charset, or a mistake in Firefox code (which I cannot reproduce).

Honestly, I would prefer just get rid if this ?download=true and leave the url as https://quarry.wmflabs.org/run/290198/output/0/html, which works fine despite having the exact same binary contents.

Great idea.

(Thinking about it again, it's 'Download data' not 'Format data')

Still, you can add one more option.

One more option of what? https://quarry.wmflabs.org/query/27365 already renders the results into html.

As you suggested, without the parameter. It is not urgent know, because you solved the problem with encoding, but maybe you can thing about it. And also about the warning I mentioned. Thank you.

If I understand correctly with the ?download=true firefox downloads the html file and then open it, but without the good encoding. Content Type is not kept during the file save.
Without this param the encoding is directly shown, correctly, using the Content Type header.

So another solution would be to add <meta charset="UTF-8"> in the file content in duplicate of the Content Type. But that would be adding content to a deliberately minimalist file.
But I prefer the other solution, which consists to get ride of this ?download=true parameter, which would solve the display by browser via a click on the link. I dont see any usefull use of this parameter. We'd already discussed this with @zhuyifei1999 I don't know where.

Framawiki renamed this task from Quarry html output has wrong encoding to Get ride of this ?download=true parameter.Sep 13 2018, 7:34 PM
zhuyifei1999 renamed this task from Get ride of this ?download=true parameter to Get rid of this ?download=true parameter.Sep 14 2018, 12:50 AM

If I understand correctly with the ?download=true firefox downloads the html file and then open it, but without the good encoding.

Yes, I can confirm that.

Change 460760 had a related patch set uploaded (by Zhuyifei1999; owner: Zhuyifei1999):
[analytics/quarry/web@master] Get rid of ?download=true

https://gerrit.wikimedia.org/r/460760

^ Note this patch will continue to download if left-clicked, but you can override the download if opened the link in new tab (might be browser-dependent though)

Change 460760 merged by jenkins-bot:
[analytics/quarry/web@master] Get rid of ?download=true

https://gerrit.wikimedia.org/r/460760

Framawiki assigned this task to zhuyifei1999.

Patch merged and deployed, but the problem is not totally solved as said in previous comment. We haven't any idea/can't do anything to resolve your exact problem.

Patch merged and deployed, but the problem is not totally solved as said in previous comment. We haven't any idea/can't do anything to resolve your exact problem.

Thank you. But I am completely satisfacted.