Closed Bug 619054 Opened 14 years ago Closed 3 years ago

Inconsistency at auto-renaming

Categories

(Firefox for Android Graveyard :: General, defect, P5)

ARM
Android
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: ioana.chiorean, Unassigned)

Details

Attachments

(1 file)

Attached image files renaming
Build Identifier: Mozilla/5.0 (Android; Linux armv7l; rv:2.0b8pre)
Gecko/20101213 Firefox/4.0b8pre Fennec/4.0b3pre 
Device Samsung Galaxy S Captivated

Steps to reproduce:
1. Download several times same file. (htm, pdf, iso)
2. Slide page to left and go to Download Manager
3. Take a look at  two identical files. 

Expected result:
- the files should be rename as :
file-2.pdf
file-1.pdf
file.pdf

Actual result:
- iso and pdf files are renamed with "-1" "-2"
- htm files are renamed with "(2)" "(3)"  

ex:
romania.pdf
romania-1.pdf
romania-2.pdf

romania.htm
romania(2.htm // no 1 present
I suspect this has to do with whether or not the files are created through the download manager or through an nsIWebBrowserPersist. The persist method has its own functions to create unique filenames and is used you call "Save Image", "Save Page", or resume a download:

http://mxr.mozilla.org/mozilla-central/source/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp#1965

The other files are running through nsIExternalHelperAppService which uses nsIFile.createUnique (in various different places depending on what we are doing with the download).

The nameing scheme used by both should probably match.
not a blocking bug, but we should consistently associate file names convention.
Flags: in-litmus+
TC https://litmus.mozilla.org/single_result.cgi?id=427155 fails due to this bug.
Whiteboard: [fennec 6.0b1]
Product: Fennec → Fennec Native
Still an issue; reproducible just save as PDF a few times on a site, and download zip's here e.g, http://ftp.mozilla.org/pub/mozilla.org/mobile/releases/24.0b10/android/multi/, pdf's use a <filename>-<n>.pdf, zips use a <filename>(n).zip for example
Whiteboard: [fennec 6.0b1]
I would like to patch this bug. Can someone provide me with mxr/dxr links? Thanks!!
(In reply to Manu Jain from comment #5)
> I would like to patch this bug. Can someone provide me with mxr/dxr links?
> Thanks!!

This isn't currently a mentor bug, but maybe wesj would be able to help you out.

If you want to try investigating on your own, you can start by digging into that link he provided in comment 1.
Flags: needinfo?(wjohnston)
The web browser persist code has moved, but now its just at:

http://mxr.mozilla.org/mozilla-central/source/embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp#1912

I'm not sure why that doesn't use nsIFile.createUnique instead. I'll ping bsmedberg in here. Maybe he knows.

This is really a platform bug if someone wants to move it.
Flags: needinfo?(wjohnston) → needinfo?(benjamin)
I really don't know why, that code is all really old.
Flags: needinfo?(benjamin)
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195

Needinfo :susheel if you think this bug should be re-triaged.
Priority: -- → P5
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: