Open Bug 1730530 Opened 3 years ago Updated 2 years ago

Migrate from an existing profile when running as a snap for the first time

Categories

(Toolkit :: Startup and Profile System, enhancement)

Firefox 92
enhancement

Tracking

()

People

(Reporter: olivier, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

This is similar to bug 1709969, but for snap packages instead of Windows app packages.

I am currently working on a launcher script for the snap package¹ that imports existing dedicated profiles (found in $HOME/.mozilla/firefox/profiles.ini) for use by the snap (which uses the legacy code path for profile management, thus requiring some tinkering with the imported profiles.ini).

¹ https://code.launchpad.net/~mozilla-snaps/+git/firefox-snap/+ref/profile-import

Actual results:

The launcher script in the snap works as a short term solution, but we should aim at replicating what was done for Windows app packages, where the import logic lives in the firefox code base.

Blocks: snap

I opened bug 1730521 for the more general case, but agree we should have this to specifically look at Snap.

Status: UNCONFIRMED → NEW
Component: Untriaged → Startup and Profile System
Ever confirmed: true
Product: Firefox → Toolkit

Mentioning this too, as I feel there are some improvements we can still do.

Looking at the profile import script in firefox, it seems that it doesn't work if ~/snap/firefox/current/.mozilla is present; that is creating problems if someone had installed firefox snap in old times but is going to now switch to snap (happening automatically on Ubuntu 22.04.01).

Maybe should it be done in a different way such:

  • If a .snap-imported (maybe versioned?) stamp file is not there, continue with importing
  • go through the ~/.mozilla/firefox/profiles.ini profiles and import the missing ones in snap folder (adding them to the ini file, ofc)
  • Maybe set StartWithLastProfile to 0 in case you are importing a profile that was not existing but the snap had another default profile already set (so users can re-select the default on startup).

To detect those who which may have already imported the profile and they're using it, we can use other strategies like looking when it has been lastly modified (used), or maybe just rename it under a new profile, leaving the user the ability to choose on startup via the native firefox dialog.

Having upgraded a machine recently from 20.04 to 22.04 there was a proper migration path. Do we still need this bug open ?

Flags: needinfo?(olivier)

Yes. The current import mechanism is an external python script that lives as a snap wrapper.
The goal of this bug is to re-implement it in a cleaner way as part of firefox itself.

Flags: needinfo?(olivier)

The default path to the config file helpers.private_mime_types_file is ~/.mime.types which is not accessible on snap builds. It needs to be moved into the snap directory if it exists, and the default path updated.

I know it’s not part of the profile strictly speaking but I think the profile migration script would be a good place to tackle this?

You need to log in before you can comment on or make changes to this bug.