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

RESOLVED FIXED in Firefox 19

Status

defect
P2
normal
RESOLVED FIXED
7 years ago
Last year

People

(Reporter: andreshm, Assigned: johan.charlez)

Tracking

unspecified
Firefox 19
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment, 7 obsolete attachments)

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.
Blocks: 651942
Posted patch patch 1 wip (obsolete) — Splinter Review
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)
Depends on: 781973
Posted image Screenshot 1 of patch 1 (obsolete) —
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)
oh indeed
Posted patch patch 2 wip (obsolete) — Splinter Review
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+
Posted patch patch 3 (obsolete) — Splinter Review
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/mozilla-central/rev/fd093acb629e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 19
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
Posted patch patch 4 (obsolete) — Splinter Review
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+
Posted patch patch 4.1 (obsolete) — Splinter Review
* Use executeSoon() instead of setTimeout().

Carrying forward r+ from 'patch 4'.
Attachment #672885 - Flags: review+
Posted patch patch 4.2 (obsolete) — Splinter Review
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]
Posted patch patch 4.3Splinter Review
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
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.