Closed Bug 801883 Opened 7 years ago Closed 7 years ago

New profile directories are hidden in Finder

Categories

(Core :: General, defect, major)

x86_64
macOS
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla19
Tracking Status
firefox18 + verified

People

(Reporter: jruderman, Assigned: smichaud)

References

Details

(Keywords: regression)

Attachments

(1 file)

1. mkdir pxa
2. firefox -profile ~/pxa/

or

1. firefox -P
2. manually create a new profile

Causes the profile folder to become hidden in Finder.

I'm guessing this is a regression from bug 718910.  This is going to screw with backups and troubleshooting (especially since it somehow manages to break the "Show in Finder" button in about:support).  Please back it out.
> This is going to screw with backups

Please provide more detail.  Are you saying that "hidden" directories don't get backed up?  And if so, backed up by what?
> Causes the profile folder to become hidden in Finder

In my tests, this only happens to the nnnnnnnn folders under ~/Library/Caches/Firefox/Profiles/ -- not those under ~/Library/Application Support/Firefox/Profiles.

> break the "Show in Finder" button in about:support

I don't see this -- probably for the reason mentioned above.

I tested with a clean profile (before the test I deleted my ~/Library/Caches/Firefox and ~/Library/Application Support/Firefox directories).
By the way, to see which files/directories are hidden using 'ls', use the 'O' flag.  For example:

ls -alO
(Following up comment #1)

Even if bug 718910 does prevent backups of the ~/Library/Caches/Firefox/Profiles/nnnnnnnn directories, does this matter?

I can see there'd be a problem if the ~/Library/Application Support/Firefox/Profiles/nnnnnnnn directories weren't backed up (since they contain settings).  But I wonder if any (important) information gets lost if you (say) delete your ~/Library/Caches/Firefox directory.
The code should only do it to the cache parent directory, not the profile directory, unless the assertion is that the cache parent directory should not be hidden either.
(Following up comment #4)

> I wonder if any (important) information gets lost if you (say)
> delete your ~/Library/Caches/Firefox directory.

Saved passwords aren't stored there.

Anyone know what *is* stored there, and if this includes anything
"important"?
I've been able to reproduce the about:support issue. The Finder window comes up, but my newly created profile is not selected. This has support impact.

I don't think this will affect robust backup systems (although I'm not sure). The first regression is enough to fix this bug though.
Assignee: nobody → smichaud
Actually I *can* reproduce this bug, using "firefox -P" -- the newly created profile directory under ~/Library/Application Support/Firefox/Profiles gets "hidden".

Don't know why I didn't see this before, or why it happens.

I'll dig further and try to find out.
Is it that, during creation, the profile directory *is* the disk cache parent directory? Is that what's supposed to happen? (Necko guys?)
(In reply to comment #9)

Turns out you're right, Cameron.

When you use the Profile Manager to create a new profile, only the profile directory under ~/Library/Application Support/Firefox/Profiles/ gets created.  The profile directory under ~/Library/Caches/Firefox/Profiles/ doesn't get created until the next time you run Firefox (*not* from the Profile Manager itself).

Under these circumstances NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR ...) and NS_GetSpecialDirectory(NS_APP_USER_PROFILE_LOCAL_50_DIR ...) both return the profile directory under ~/Library/Application Support/Firefox/Profiles/.  So that directory gets hidden.
Attached patch Possible fixSplinter Review
Fixing the problem described in comment #10 in nsCacheService.cpp would have been very difficult.

But along the way I discovered that nsXREDirProvider::SetProfile() ensures the existence of both user profile directories every time the full app is run standalone (not from the Profile Manager).  So this seems a good place to put the code that hides the cache profile directory.

I've started a tryserver build, which should be available in a few hours.
That looks good, but I still politely suggest that the behaviour in comment 9 is a bug (or at least doesn't match expectation).
> That looks good, but I still politely suggest that the behaviour in
> comment 9 is a bug

I suppose it is ... or a design flaw.  But it's a very old one -- it
dates back at least to the patch for bug 291033.  (Note what's said
about the "temp directory" and the "temp profile directory", which in
the context of bug 291033 mean the "cache directory".)

http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/toolkit/xre&command=DIFF&root=/cvsroot&file=nsAppRunner.cpp&rev1=1.82&rev2=1.83#6
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/toolkit/xre&command=DIFF&root=/cvsroot&file=nsAppRunner.cpp&rev1=1.82&rev2=1.83#8

Which I suspect means it'll be a lot easier to work around it than
"fix" it.

And in this bug's case it's very easy to change the location of your
chflags fix.  The only downside is that, in its new location, the
chflags code doesn't run when Firefox is launched from the Profile
Manager.  I personally don't think that's a big deal.  But if someone
else does, please let us know.
Comment on attachment 673479 [details] [diff] [review]
Possible fix

This is the simplest way to fix this bug that I can find.

The only downside (that I'm aware of) is that (in its new location) the chflags code doesn't run when Firefox is launched from the Profile Manager (or run from the commandline using the -profile parameter).
Attachment #673479 - Flags: review?(joshmoz)
In the -profile case, I think it's good that Firefox doesn't make a directory in ~/Library/Caches/.  That would add a step to deleting the profile.

Here's what I'd like to see in that case:

~/pxb/                      visible
~/pxb/caches/               visible
~/pxb/caches/http/          hidden
~/pxb/caches/media/         hidden
~/pxb/caches/safeb/         hidden
~/pxb/caches/startup/       hidden
~/pxb/caches/thumbnails/    hidden
I'd prefer just to do nothing in the -profile case (as my current patch does).  It's much simpler and less likely to cause trouble.
Attachment #673479 - Flags: review?(joshmoz) → review+
https://hg.mozilla.org/mozilla-central/rev/b9a482aa8e57
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
(In reply to Steven Michaud from comment #18)
> Landed on mozilla-inbound:
> https://hg.mozilla.org/integration/mozilla-inbound/rev/b9a482aa8e57

Please nominate for aurora uplift considering the risk to aurora/testing completed on m-c or any other qa testing needed here .
Comment on attachment 673479 [details] [diff] [review]
Possible fix

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 718910
User impact if declined: Problems running Firefox with -P or -profile startup parms
Testing completed (on m-c, etc.): Has been on trunk for several days with no reported problems
Risk to taking this patch (and alternatives if risky): The patch is simple and low-risk
String or UUID changes made by this patch: none
Attachment #673479 - Flags: approval-mozilla-aurora?
Attachment #673479 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
QA Contact: virgil.dicu
I could reproduce this on 2012-10-15 Firefox Nightly
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/19.0 Firefox/19.0
Build ID: 20121015030612
I created a new profile from Terminal and started Nightly.  As soon as Nightly starts, the profile becomes hidden in  ~/Library/Application Support/Firefox/Profiles/. 
I runed in Terminal the command "defaults write com.apple.Finder AppleShowAllFiles TRUE"  to show the hidden filles, and I could see the profile was there, but hidden.

Tested on 2012-11-01 Firefox Aurora for the fix
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:18.0) Gecko/18.0 Firefox/18.0
Build ID: 20121101042011
Same steps as above, and the profile does not hide anymore in ~/Library/Application Support/Firefox/Profiles/ after Aurora starts.

Profile does not hide anymore at startup also for Latest Nightly, Latest Aurora and Firefox 18.0 beta 1.

Anything else I could help here?
Virgil, it would be great if you could verify that we're still getting the benefit of bug 718910 for both old and new profiles.

For profiles created by running Firefox {17 or older, 18 or later} normally for the first time, two directories should be created:

one in    ~/Library/Application Support/Firefox/Profiles/
one in    ~/Library/Caches/Firefox/Profiles/

After running Firefox 18 on the same profile, the directory in "Caches" should be hidden in Finder (but still visible with "ls").
I followed steps from comment 24, installed: 
- Firefox 18.0 beta 1 
- Firefox 17.0
- Latest Nightly
- Latest Aurora
on Mac OS X 10.8. 

After running each version of Firefox, for the first time two directories were created:

~/Library/Application Support/Firefox/Profiles/
~/Library/Caches/Firefox/Profiles/

I moved to trash "Firefox" folders after each use, so I could see exactly how the new folders are created for each version of FF.

Folders from above are visible only from "Show in Finder" in about:support.

Directory "Caches" is hidden in Finder but visible with "ls" command in Terminal.
> Folders from above are visible only from "Show in Finder" in about:support.

Which ones?  Hopefully the ones within in "Application Support" are visible and the ones within "Caches" are not...

> Directory "Caches" is hidden in Finder but visible with "ls" command in Terminal.

The "Caches" directory itself, or the folder inside 
~/Library/Caches/Firefox/Profiles/ ?  If the former, you can press Cmd+Shift+G in Finder to go to ~/Library/Caches/ and see what within it is also hidden to finder.
> Which ones?  Hopefully the ones within in "Application Support" are visible
> and the ones within "Caches" are not...

Tested on
- Firefox 18.0 beta 2 
- Firefox 17.0.1
- Latest Nightly
- Latest Aurora

Mountain Lion/Users/testuser/Library/Application Support/Firefox/Profiles/ - folders inside the "Profiles" are visible in Finder.

Mountain Lion/Users/testuser/Library/Caches/Firefox/Profiles - folders inside the "Profiles" are NOT visible in Finder for none of the versions tested, except for the Firefox 17.0.1 where the "default" profile is visible in Finder as soon as I start Firefox after installation. 

I created a new profile, opened a new tab, closed Firefox 17.0.1, started  again FF with the new profile and this profile is getting visible in Mountain Lion/Users/testuser/Library/Caches/Firefox/Profiles in Finder.
This is not applicable for the other versions tested.


> The "Caches" directory itself, or the folder inside 
> ~/Library/Caches/Firefox/Profiles/ ?  If the former, you can press
> Cmd+Shift+G in Finder to go to ~/Library/Caches/ and see what within it is
> also hidden to finder.

Mountain Lion/Users/testuser/Library/Caches/Firefox/Profiles

Folders inside the "Profiles" folders are not visible in Finder but if I "cd" this route in Terminal and then I enter "ls", it shows me in Terminal the profiles created.


Pressing Cmd+Shift+G in Finder sends me to 

Mountain Lion/Library/Caches/ 

"cd" this route in Terminal and then "ls" shows me the exact content as in Finder.

I hope this helped. Anything I could do further here?
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.