Closed Bug 1794238 Opened 2 years ago Closed 2 years ago

Save page results in save error

Categories

(Firefox :: File Handling, defect)

Firefox 106
defect

Tracking

()

RESOLVED DUPLICATE of bug 1445211

People

(Reporter: uiy12345, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0

Steps to reproduce:

When I right mouse and click save page as... and save the page, many times the page will be saved but the icon will show an retry icon AND it will say failed.

The file will generally be saved though. Clicking on the refresh will save the page.

This does not happen with all sites. In particular it happens with reddit and may be related to dynamically loaded content.

The issues are:

  1. It reports the saved page as having failed when it doesn't.
  2. When retrying it the new download that succeeds usually is a different size.

both are annoying because I have no idea really what to do. I've always retried but I think it loads up the page not as it is shown in my browser but sort of reloads it from scratch. This causes problems with dynamically loaded data though as it won't save it and usually why the first save has a larger file size. Unfortunately the files display blank for some reason so I can't actually compare. They are blank but do have the content... this has something to do with the script that seems to hide the page. I don't bother too much with it because I'm archiving the pages but I'd like it to just save it without pretending there is an error unless there really is.

Actual results:

Reports a failed save in the downloads and shows the refresh icon.

Expected results:

Not sure... but I don't think I should get an error unless, say, the page is corrupted. I have no idea why firefox is reporting it as an error as it seems to work.

Because I've gotten so used to thinking it is an error and I don't know if it really is an error I always redownload it but I think it's not saving the dynamic content I generated so the actual saved page(the 2nd one that overwrites the first) is less info.

The Bugbug bot thinks this bug should belong to the 'Firefox::File Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → File Handling

Hi uiy12345, can you please share one of the links that is causing this issue so we can try to reproduce it on our side as well ? If you have any websites with weird non ascii characters that is causing this issue please share them with us we can try to reproduce this issue on our side.

Flags: needinfo?(uiy12345)

(In reply to Rares Doghi from comment #3)

Hi uiy12345, can you please share one of the links that is causing this issue so we can try to reproduce it on our side as well ? If you have any websites with weird non ascii characters that is causing this issue please share them with us we can try to reproduce this issue on our side.

Every single page from reddit does this. Any link will work from www.reddit.com. Other sites sometimes do it and sometimes don't but I always have the issue with reddit 100% of the time.

https://old.reddit.com/r/Superstonk/new/

Pick any article from it such as

https://www.reddit.com/r/Superstonk/comments/y0twfv/drs_usanne_trimbath_on_twitter/?sort=new

https://www.reddit.com/r/Superstonk/comments/y0tefd/comment_to_the_sec_on_reporting_of_securities/?sort=new

Of course it is possible that it is some extension I'm running or whatever as I haven't tried it in any other browser. Either way it suggests there is a bug in firefox somewhere as it shouldn't do the behavior it is doing. It almost always successfully.

This one gives the error when I do a take screenshot... having to do with the filename.

https://www.reddit.com/r/Superstonk/comments/v7yucj/virtu_ceo_to_the_extent_there_is_not_liquidity_on/?utm_source=share&utm_medium=web2x&context=3%3Fsort%3Dnew%3Fsort%3Dnew%3Fsort%3Dnew%3Fsort%3Dnew

the filename is "Screenshot 2022-10-10 at 19-13-45 r_Superstonk - Virtu CEO to the extent there is not liquidity on a lit exchange fundamentally the wholesalers are providing INFINITE LIQUIDITY at the NBBO. If price is supply vs demand what happens with an infini[...].png"

Which fails to download unless I shorten it. There are no bad chars in it.

When I save page as it always "fails" though(screenshots don't always fail) but sometimes it is due to the length of the filename(or whatever and usually will always fail if screenshot fails too) or it will actually save the page but say it failed and it will be of a different size than previously.

this suggests the bug is 1. Around filename length handling && 2. Around testing if the file was downloaded, e.g., "if !exists(fn) show_failed" when the file does exist. However it checks for existence isn't working correctly. Maybe some of the items fail to download such as images and so it reports the entire thing as failed but still retains the files? Clicking redownloaad though downloads it all but gets a different copy without the dynamic info.

For example,

https://www.reddit.com/r/Superstonk/comments/y0ln0r/ben_bernanke_former_chairman_of_the_fed_now/?sort=new

scroll down a bit to load far more comments and save page as. If it fails on you then you should still have a copy. Copy the files to a different place. Refresh the page and don't scroll then save page as. Then compare the files. They should be different sizes.

Flags: needinfo?(uiy12345)

Do you have any adblockers, either at the network level or as a Firefox add-on?

I can reproduce the problem with a pi-hole in the network, but it works properly as soon as a I disable it, thus I suspect this is a dupe of Bug 1445211, but please let us know which kind of blocker you have, if any, and whether the problem is solved if you temporarily disable it.

Flags: needinfo?(uiy12345)

I do and it looks like it is probably the same problem(although the bug I gave for the file name issues is not but was merged to this one for some reason). I have ublock installed along with adblock.

The thing is, why would it matter? If they are blocking resources causing a failure then retrying to still cause the same failure. If it's some quirky thing, it still seems to be an issue. I'm sure most people will agree that when they save page as they want to save the page as they experience it so if something is blocked it should be blocked in the save page too. That is, whatever firefox does after processing the page(including extensions) is what should be saved. I would expect that all that would be done is the source would be saved as it is shown along with all the resources the page uses(and hence if they are blocked it is not using them and doesn't have to be downloaded and so no error).

Flags: needinfo?(uiy12345)

(In reply to uiy12345 from comment #7)

I would expect that all that would be done is the source would be saved as it is shown along with all the resources the page uses

This means rewriting the source to refer to the downloaded resources, and fetching those resources to the locations referred to

(and hence if they are blocked it is not using them and doesn't have to be downloaded and so no error).

The 20-or-so-year-old code makes no attempt to work out "did this script [or img/frame/whatever] tag actually get downloaded successfully [and therefore should I save a copy]".

Even if it did, it might come to the wrong conclusion - it would depend entirely on distinguishing "blocked" from "network failure", which especially with network-based blockers isn't actually a trivial problem to solve.

As always, "just" fixing this to behave the way "most people will agree" it should work is harder than it may appear at first glance.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.