Closed Bug 1933222 Opened 1 year ago Closed 1 year ago

[Mac] The Firefox icon for the "Original Profile" is missing. Only the profile avatar is visible.

Categories

(Toolkit :: Startup and Profile System, defect, P2)

Firefox 134
defect

Tracking

()

VERIFIED FIXED
138 Branch
Tracking Status
firefox134 --- wontfix
firefox138 --- verified

People

(Reporter: rpopovici, Assigned: jhirsch)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [fidefe-profile-management])

Attachments

(10 files)

Found in:
Nightly 134.0a1

Affected versions:
Nightly 134.0a1

Tested platforms:
Affected platforms: macOS 13.2.1

Preconditions:
Ensure that the pref "browser.profiles.enabled" is set to true in about:config.
The system theme is set to Dark and Firefox is pinned to the Dock.

Steps to reproduce:

  1. Open the Profiles panel from the menu bar
  2. Create a profile by using the "New profile" option
  3. Observe the Firefox icon added for the "Original Profile" in the Dock

Expected result:
The Firefox icon with a pre-selected avatar for the "Original Profile" should be properly displayed in the Dock.

Actual result:
The Firefox icon for the "Original Profile" is missing. Only the profile avatar is visible. Please see the screenshot with the heart avatar.

Regression range:
This is not a regression.

Whiteboard: [fidefe-profile-management]

:mossop, I'm happy to attempt a fix here. Any thoughts on a good starting point for debugging?

Flags: needinfo?(dtownsend)

I would guess something is going wrong when we draw the application icon for the custom dock tile. It would be interested to see if a similar problem occurs when not using multiple profiles and downloading a large file. This causes us to also build a custom dock tile to overlay the download progress bar.

Flags: needinfo?(dtownsend)

The severity field is not set for this bug.
:mossop, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(dtownsend)

Mass setting S2 severity for 0.5% release bugs. Apologies for the bug spam!

Severity: -- → S2
Priority: -- → P2
Flags: needinfo?(dtownsend)
Assignee: nobody → dtownsend

I've been unable to reproduce this on my laptop. Is this still reproducible for you?

Flags: needinfo?(rpopovici)

(In reply to Dave Townsend [:mossop] from comment #5)

I've been unable to reproduce this on my laptop. Is this still reproducible for you?

And if so can you try reproducing without profiles enabled and starting a long download. This should overlay a progress bar on the dock icon and I'm interested in whether the icon also disappears in this case.

I reproduced this by creating a new secondary profile (for the first time after enabling the pref), switching back to the original profile, and then switching back again to the newly-created secondary profile. I've closed the window with the secondary profile, and the missing icon still remains for the original profile.

Flags: needinfo?(rpopovici)

I noticed that I could reproduce this bug after restarting my device(macOS 13.2.1), opening Nightly 136.0a1(already pinned to the dock), and creating a switching profile. The icon is missing for the "Original profile". Please see my screenshot.

(In reply to Cieara Meador [:cmkm] from comment #7)

Created attachment 9446398 [details]
Screenshot 2025-01-08 at 16.59.12.png

I reproduced this by creating a new secondary profile (for the first time after enabling the pref), switching back to the original profile, and then switching back again to the newly-created secondary profile. I've closed the window with the secondary profile, and the missing icon still remains for the original profile.

Can you still reproduce this? When you talk about switching between profiles how exactly were you doing that?

Can you also try to see if comment 6 shows the same issue?

Flags: needinfo?(cmeador)

Hi Raluca, can you still reproduce this in the latest Nightly? We think this is now fixed

Flags: needinfo?(rpopovici)
Attached image latestNightly.png
Flags: needinfo?(rpopovici)

Hi Jared,
Yes, I could reproduce the issue by installing the latest Nightty 136.0a1(27-01-2025). I'll attach the new screenshots.

Don't forget the preconditions:

  1. Ensure that the pref "browser.profiles.enabled" is set to true(the pref is already enabled by default on the latest Nightly) in about:config.
  2. The system theme is set to Dark and Firefox is already pinned to the Dock.

Steps:

  1. Open the Profiles panel from the menu bar.
  2. Create a profile by using the "New profile" option.
  3. Observe the Firefox icon added for the "Original Profile" in the Dock and the "Profiles" menu.
Attached image latestNightly1.png

(In reply to Raluca Popovici, Desktop QA from comment #13)

Hi Jared,
Yes, I could reproduce the issue by installing the latest Nightty 136.0a1(27-01-2025). I'll attach the new screenshots.

Please can you try what I asked for in comment 6?

Flags: needinfo?(rpopovici)

I set the pref to false and start to download a long video -> the browser icon is visible on the Dock. See the screenshot.

Flags: needinfo?(rpopovici)

A long download didn't seem to affect this in my testing. Clearing NI since I haven't been able to pinpoint any more specific steps here than the ones mentioned. I'll update if I manage to do so in the future.

Flags: needinfo?(cmeador)

I am still unable to reproduce this so I'm not sure it is worth me staying assigned. I would guess that the error lies somewhere in here and maybe there is something special we need to do for dark mode but looking over the macOS docs doesn't show anything obvious. That said if this is working for the download progress case I'm really unsure what might be happening because that is the same codepath.

Assignee: dtownsend → nobody

I have some more info which might help with diagnosis.

I suspect there are app bundle icon caching issues at play, because I was able to reproduce on macOS 15 without pinning to the dock, but only on the first run after a clobber build in a brand new profile.

Steps to Reproduce:

  • set the system to dark mode (Settings > Appearance > Dark)
  • it's helpful to set the dock to turn hiding off (right-click the dock > Turn Hiding Off)
  • do a clobber build (very important!)
  • start nightly via ./mach run -P and create a new profile
  • observe the Nightly icon in the dock. it looks normal.
  • in nightly, open the app menu and click 'profiles' then click 'new profile'
  • once the second dock entry finishes animating in, the original dock item goes blank except for the badge.

I suspect the issue is something to do with app bundle icon caching, or something about our dark mode icon, since I can't reproduce twice without a clobber build, and I can't reproduce the bug in light mode.

The only way I could see this affecting users would be in dark mode, on first run, which could well be users installing Firefox specifically to try out multiple profiles.

Does this help narrow things down at all?

Flags: needinfo?(dtownsend)

(In reply to Jared Hirsch [:jhirsch] (he/him) (Needinfo please) from comment #20)

Created attachment 9466996 [details]
dock icon screen recording

I have some more info which might help with diagnosis.

I suspect there are app bundle icon caching issues at play, because I was able to reproduce on macOS 15 without pinning to the dock, but only on the first run after a clobber build in a brand new profile.

Steps to Reproduce:

  • set the system to dark mode (Settings > Appearance > Dark)
  • it's helpful to set the dock to turn hiding off (right-click the dock > Turn Hiding Off)
  • do a clobber build (very important!)
  • start nightly via ./mach run -P and create a new profile
  • observe the Nightly icon in the dock. it looks normal.
  • in nightly, open the app menu and click 'profiles' then click 'new profile'
  • once the second dock entry finishes animating in, the original dock item goes blank except for the badge.

I suspect the issue is something to do with app bundle icon caching, or something about our dark mode icon, since I can't reproduce twice without a clobber build, and I can't reproduce the bug in light mode.

The only way I could see this affecting users would be in dark mode, on first run, which could well be users installing Firefox specifically to try out multiple profiles.

Does this help narrow things down at all?

It suggests that this is a bug in macOS. We just ask for the application icon to be drawn and macOS is meant to take care of that. It's possible we might get a different result by manually loading the application icon from the application bundle.

Flags: needinfo?(dtownsend)

Hmm. What if we attempted to add some kind of delay when we first badge the original profile's icon, in case it's an obscure timing issue on the macOS side? (I might take this on, but also wonder if you have thoughts on who on the platform team might have thoughts on a workaround.)

Flags: needinfo?(dtownsend)

spohl is most likely to have some idea about this.

Flags: needinfo?(dtownsend) → needinfo?(spohl.mozilla.bugs)

I can't speak to the timing issue directly, but I'd try to parse the Console logs to see if there are any messages that might be relevant. There are tons of log entries and it can become difficult to parse, so I'd suggest starting logging right before reproducing the issue and stopping right after to reduce the size of the log. Searching for anything along the lines of "dock" might help narrow things down. I would be looking for any kind of error message or warning related to setting the Dock icon.

Flags: needinfo?(spohl.mozilla.bugs)

Thanks--I'll do some logging in a debug build and see if I find any dock-related errors. I'll also try to step through the code mossop linked in comment 19 in XCode and see if the debugger being attached has any effect on whether the bug can be reproduced.

I can't seem to reproduce this in a debug build at all with XCode attached, which makes me more suspicious that it's a race condition.

Assignee: nobody → jhirsch
Status: NEW → ASSIGNED
Attached video timeout-fix.mov

I wasn't able to reproduce the bug with the XCode debugger attached, which was especially onerous because the bug can only be reproduced on the first run after a clobber build.

However, since we kick off the second Firefox instance from JS, I played around a bit with inserting delays at various points in the flow.

As a reminder, the steps I'm following are:

  • have macOS in dark mode
  • run an artifact clobber build into a fresh profile
    • so, ./mach clobber && ./mach build && ./mach run -P, create a new profile, then start into it
  • in profile 1, in the app menu, click profiles > new profile
  • profile 2 is created and launched
  • the profile 2 icon animates into the dock with a badge
  • the profile 1 icon in the dock is badged, but the firefox/nightly icon vanishes

It turns out (see screencast and attached patch) that we can hack around this bug by overwriting the missing dock icon, but only after the dock animation ends for profile 2. Shorter timeouts do not fix the bug (for example, using 100 millisecond delay instead of 1000 in the patch).

:spohl, does this provide any additional clues as to where the bug might be lurking?

Flags: needinfo?(spohl.mozilla.bugs)

(In reply to Jared Hirsch [:jhirsch] (he/him) (Needinfo please) from comment #28)

:spohl, does this provide any additional clues as to where the bug might be lurking?

Unfortunately not.

Flags: needinfo?(spohl.mozilla.bugs)

To my surprise, the hacky solution is now accepted, so I've filed followup bug 1952338 in hopes that we someday figure out the "right" fix.

Pushed by jhirsch@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/02e113890073 Work around vanishing macos dock icon by overwriting it a second later. r=mossop,spohl,profiles-reviewers

Hi Raluca - It seems like this bug may actually be a bug in macOS. To improve the situation for 138, I've found a hacky fix where the icon still disappears, then we redraw it 1 second later. I've filed a followup bug (bug 1952238) for us to try to find a better fix in the future. At least this makes the situation better for new users.

Flags: needinfo?(rpopovici)
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch

I verified the fix on macOS 13.2.1 using the Nightly treeherder build from 07-03-2025, and I noticed that the newly created profile doesn't have an avatar icon (please see the screenshot). Should I file a new bug or reopen the existing one?

Flags: needinfo?(rpopovici)
Flags: needinfo?(jhirsch)

Hi Raluca - I think the missing badge would make sense as a separate bug--I thought there was a bug for a missing badge, but I can't seem to find it now. (I have noticed the missing badge seems to occur when the user has the "system auto" theme, but I'm not sure if that's the only case.)

Flags: needinfo?(jhirsch)

I just found the mentioned bug: 1950167.
I will close this one and keep track of the bug 1950167.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: