Open recent file fails if the file doesn't exists anymore

RESOLVED FIXED in Firefox 19

Status

P2
normal
RESOLVED FIXED
6 years ago
5 months ago

People

(Reporter: andreshm, Assigned: johan.charlez)

Tracking

unspecified
Firefox 19
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-fx-team])

Attachments

(1 attachment, 7 obsolete attachments)

(Reporter)

Description

6 years ago
The issue is when you open a file using the File > Open Recent menu, but the file doesn't exists anymore. 

Currently it shows two selected items in the list and there is an error in console: 

JavaScript error: resource://gre/modules/NetUtil.jsm, line 165: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIChannel.asyncOpen]

I suggest to open the file picker and remove/update the entry on the recent list.
Hi Andres. Thanks for the bug report. Good catch.
(Assignee)

Updated

6 years ago
Blocks: 651942
(Assignee)

Comment 2

6 years ago
Created attachment 663543 [details] [diff] [review]
patch 1 wip

WIP patch:

I'm using the nofication bar to tell the user if a file doesn't exist.

Thoughts?
Assignee: nobody → johan.charlez
Status: NEW → ASSIGNED
Attachment #663543 - Flags: review?(rcampbell)
(Reporter)

Updated

6 years ago
Depends on: 781973
(Assignee)

Comment 3

6 years ago
Created attachment 663545 [details]
Screenshot 1 of patch 1
Attachment #663545 - Flags: ui-review?(rcampbell)
Comment on attachment 663543 [details] [diff] [review]
patch 1 wip

should at least clear the entry from the recent files list too.
Attachment #663543 - Flags: review?(rcampbell)
(Assignee)

Comment 5

6 years ago
oh indeed
(Assignee)

Comment 6

6 years ago
Created attachment 663571 [details] [diff] [review]
patch 2 wip

Introduced a new method for clearing one or more files.

* Clears the file from the menu.
Attachment #663543 - Attachment is obsolete: true
Attachment #663571 - Flags: review?(rcampbell)
Comment on attachment 663545 [details]
Screenshot 1 of patch 1

The language feels a little funny here. Mostly the "you" makes it sound like we're having a conversation with the user.

How about, "This file no longer exists."?
Attachment #663545 - Flags: ui-review?(rcampbell)
Comment on attachment 663571 [details] [diff] [review]
patch 2 wip

looks good.

Thought about a test yet?
Attachment #663571 - Flags: review?(rcampbell) → feedback+
(Assignee)

Comment 9

6 years ago
Created attachment 666664 [details] [diff] [review]
patch 3

Changes in this version:
1. Changed the name of the l10n-string from 'fileExists.notification' to 'fileNoLongerExists.notification'.

2. Added tests.

3. Changed the notification value from 'SCRATCHPAD_CONTEXT_BROWSER' to "file-no-longer-exists".

4. Changed the notification label per your feedback.

5. Rebased 2012-10-01.

Cheers!
Attachment #663545 - Attachment is obsolete: true
Attachment #663571 - Attachment is obsolete: true
Attachment #666664 - Flags: review?(rcampbell)
Comment on attachment 666664 [details] [diff] [review]
patch 3

looks good! We should send this through the try servers for our amusement.
Attachment #666664 - Flags: review?(rcampbell) → review+
Whiteboard: [try-run]
sorry for the delay, Johan.

Try results here:

https://tbpl.mozilla.org/?tree=Try&rev=a8a9a50ce32e
Whiteboard: [try-run] → [land-in-fx-team]
https://hg.mozilla.org/integration/fx-team/rev/fd093acb629e
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/fd093acb629e
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 19

Updated

6 years ago
Depends on: 801660
Unfortunately I had to back this out for causing bug 801660.

Backout:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7703f0ec6770
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: Firefox 19 → ---
(In reply to Ed Morley [:edmorley UTC+1] from comment #14)
> Unfortunately I had to back this out for causing bug 801660.
> 
> Backout:
> https://hg.mozilla.org/integration/mozilla-inbound/rev/7703f0ec6770

https://hg.mozilla.org/mozilla-central/rev/7703f0ec6770
(Assignee)

Comment 16

6 years ago
Created attachment 672046 [details] [diff] [review]
patch 4

Thank you Ed :)

This patch should hopefully fix the intermittent oranges.

Rob, could you take another look?

Changes from previous patch:
1. The test now removes 'gFile04' rather than 'gFile02'. 'gFile02' was the active file in Scratchpad and might have been what caused the failures.

2. Added the function 'waitForFileDeletion()'. This should make sure the file ('gFile04') has been removed before proceeding with the test.

Cheers!
Attachment #666664 - Attachment is obsolete: true
Attachment #672046 - Flags: review?(rcampbell)
Comment on attachment 672046 [details] [diff] [review]
patch 4

+function waitForFileDeletion() {
+  if (gFile04.exists()) {
+    setTimeout(waitForFileDeletion, 0);

you can use executeSoon() instead of setTimeout() here. Otherwise looks good. I'll send it through the try gauntlet.
Attachment #672046 - Flags: review?(rcampbell) → review+
(Assignee)

Comment 18

6 years ago
Created attachment 672885 [details] [diff] [review]
patch 4.1

* Use executeSoon() instead of setTimeout().

Carrying forward r+ from 'patch 4'.
Attachment #672885 - Flags: review+
(Assignee)

Comment 19

6 years ago
Created attachment 673877 [details] [diff] [review]
patch 4.2

Rebased,

cheers!
Attachment #672046 - Attachment is obsolete: true
Attachment #672885 - Attachment is obsolete: true
Attachment #673877 - Flags: review?(rcampbell)
Priority: -- → P2
Comment on attachment 673877 [details] [diff] [review]
patch 4.2

this should work
Attachment #673877 - Flags: review?(rcampbell) → review+
Whiteboard: [land-in-fx-team]
Johan, this patch needs rebasing.
Whiteboard: [land-in-fx-team]
(Assignee)

Comment 22

6 years ago
Created attachment 678870 [details] [diff] [review]
patch 4.3

rebased
Attachment #673877 - Attachment is obsolete: true
Attachment #678870 - Flags: review?(rcampbell)
Attachment #678870 - Flags: review?(rcampbell) → review+
https://hg.mozilla.org/integration/fx-team/rev/fd245024ffad

\o/

Thanks, Johan!
Whiteboard: [fixed-in-fx-team]
This landed on m-c some time ago, but the bugs were not updated:
https://hg.mozilla.org/mozilla-central/rev/fd245024ffad
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19

Updated

5 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.