fedora-silverblue / issue-tracker

Fedora Silverblue issue tracker
https://fedoraproject.org/atomic-desktops/silverblue/
125 stars 3 forks source link

Incompatible firefox-langpacks version #525

Closed gjask closed 5 months ago

gjask commented 5 months ago

Describe the bug Default Firefox installation refuses to use czech localization as it is of incompatible version. I assume there is incompatible version of langpack packed into firefox-langpacks package. It is possible this is Workstation issue, but currently I have no available system to test it on myself. I've tried to replicate this issue in freshly installed (and updated) Workstation in Boxes but it works as expected. So this seems to be Silverblue issue.

To Reproduce Please describe the steps needed to reproduce the bug:

  1. Select czech localization during Silverblue installation (I don't know if there is other way to change localization to already installed system, I suppose there should be some, but I haven't tested it)
  2. Update system after installation
  3. Open extension tab in Firefox and check if langpack is available and applied

Expected behavior Firefox should be localized into Czech and show installed czech langpack in extension tab.

Screenshots Snímek obrazovky z 2024-01-10 21-22-19

OS version:

State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: last run 4h 40min ago
BootedDeployment:
● fedora:fedora/39/x86_64/silverblue
                  Version: 39.20240110.0 (2024-01-10T00:43:08Z)
               BaseCommit: 8ceba7ffc72ba4a0a23390797d30b6a24edfc07053111292ac42b4365bc8e27f
             GPGSignature: Valid signature by E8F23996F23218640CB44CBE75CF5AC418B8E74C
          LayeredPackages: distrobox ffmpeg-free fzf gnome-tweak-tool htop httpie ipython
                           langpacks-cs libavcodec-freeworld mozilla-openh264 mycli
                           python3-csvkit rpmfusion-free-release rpmfusion-nonfree-release
                           tilix vim virtualenv wl-clipboard

Additional context

$ rpm -qa | grep firefox
firefox-langpacks-121.0-3.fc39.x86_64
firefox-121.0-3.fc39.x86_64
chrisawi commented 5 months ago

I can't reproduce this here with LANG=cs_CZ.utf8 /usr/bin/firefox. Firefox correctly loads the langpack version 121 and is translated.

From the timestamp, this must be an ostree-packaged file, but maybe Firefox has a stale cache? Can you try a fresh profile, or even a fresh user account?

gjask commented 5 months ago

From the timestamp, this must be an ostree-packaged file, but maybe Firefox has a stale cache? Can you try a fresh profile, or even a fresh user account?

Yeah, it works just fine for newly created user. I did some more testing but I didn't discover much. Firefox correctly loads langpack first time it is run for the user and keeps working until update providing new Firefox and langpack version. After that the profile seems to be fixed on that previous langpack version.

I can only guess that Firefox does cache that extension somewhere and that cache is not invalidated when new extension is available. I also guess it could be because timestamp on new extension file is same as previous one.

travier commented 5 months ago

Thanks for the investigation. This would likely be better fixed in Firefox. Not sure what else we could do in Silverblue.

gjask commented 5 months ago

Well it probably could be also fixed in Firefox package. Firefox rpm already contains a bash script responsible for creating symlink for a langpack in home directory. This is done so new version of langpack is installed together with new version of firefox from package. This script could be upgraded to work around this issue in Silverblue (eg. copy file instead of symlink).

https://src.fedoraproject.org/rpms/firefox/blob/f39/f/firefox.sh.in#_214

It still may be a good idea to check with upstream if they have a good way to fix this. But from my point of view it is downstream feature that is broken.

travier commented 5 months ago

Hum, interesting, this would indeed be a Fedora specific bug. But then the question becomes: why does this script not work on Silverblue?

gjask commented 5 months ago

Hum, interesting, this would indeed be a Fedora specific bug. But then the question becomes: why does this script not work on Silverblue?

Oh it does in a way. It creates symlink same as on Workstation. I have (not yet confirmed) theory that Firefox reloads metadata from extension only when file timestamp changes. And it does on Workstation when new version of rpm is installed. But on Silverblue that original file always has zero timestamp across deployments. So Firefox doesn't reload extension and believes in its own cached extension metadata that says that is an old one.

travier commented 5 months ago

Hum, so there are multiple layers of caching here. 😕

gjask commented 5 months ago

I don't think there are multiple layer of cache. Until now I have noticed only one and that is extension metadata firefox does store in extensions.json in profile dir.

That script from fedora RPM just makes sure there is prepared symlink in home dir pointing to current langpack installed from firefox-langpacks anytime when Firefox is started.

travier commented 5 months ago

It's probably best to submit a bug in bugzilla for the firefox package as the developers there should have more knowledge about how all of this works.

xhorak commented 5 months ago

Yes, it's the timestamp what's checked during checking newer version. It's a downstream issue, I'll fix the launch script.

gjask commented 5 months ago

@xhorak How is it going? Can I do something to help?

xhorak commented 5 months ago

@xhorak How is it going? Can I do something to help?

It should be fixed by upcoming firefox-122.0 release.

gjask commented 5 months ago

Thanks. I did check open PRs from time to time but I had to miss it. Also I should have checked commits, my bad. :D

gjask commented 5 months ago

And it seems to be already present in current build and working correctly. Thank you for fixing the issue.

travier commented 5 months ago

Fix for reference: https://src.fedoraproject.org/rpms/firefox/c/588e3b01fb7467b97e71f7e1c04832e690a1d36c?branch=rawhide