Software Center doesn't save settings on Saucy

Bug #1244493 reported by Mike L
80
This bug affects 13 people
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Fix Released
High
dobey

Bug Description

Certain settings will be reset for some odd reason whenever I quit the Software Center. Here's the main two areas where I notice this issue, both accessible under "View" in the global menu:
1) Attempting to toggle on or off the option "New Applications in Launcher", regardless of what it's set to upon an exit and repopening of the Software Center it's set back to the default option of a check, meaning it will show new applications in the launcher regardless of what the user has set it to.
2) Attempting to select the option "Turn on Recommendations..." will also alow me to turn them on, but upon closing and opening up the Software Center again, I have to re-enable recommendations if I want them

Running Ubuntu 13.10 Suacy with all the latest updates, with the latest version of the Software Center (13.10). Yes I have proposed updates enabled, but this may have happened at first with the original package in Saucy as well. Regardless, these are official packages and this is a usability bug in need of a fix. The settings don't save (I remember they saved in previous Ubuntu versions) but they no longer do. Obviously, these settings should save somewhere for a consistent experience.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: software-center 13.10-0ubuntu1
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic x86_64
ApportVersion: 2.12.5-0ubuntu2.1
Architecture: amd64
Date: Thu Oct 24 21:59:17 2013
InstallationDate: Installed on 2013-10-17 (7 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: software-center
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Mike L (mikerl) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-center (Ubuntu):
status: New → Confirmed
Changed in software-center (Ubuntu):
importance: Undecided → High
Revision history for this message
Bruno Nova (brunonova) wrote :

I also have this problem.

As a workaround, you can toggle those options by editing the file ~/.config/software-center/softwarecenter.cfg directly and changing the respective True/False values.

On another note, when that file is open in Gedit when I close the Ubuntu Software Center (USC), Gedit reports that the file was changed externally (but the contents remain the same).

Revision history for this message
Bruno Nova (brunonova) wrote :

I've been poking around in the code and here's what I found until now:

In file softwarecenter/config.py:

* In the write(self) method, the configuration properties always have the values that are read from the config file (at least for boolean properties) and, thus, the config file contents are not changed on save.
  The method works correctly though: If I call 'self._generic_setbool("recommender_opt_in_requested", True)' manually, it takes effect and that value is written to the config file.

* I added some LOG messages to the methods _generic_get, _generic_set, _generic_getbool and _generic_setbool to see if they are called.
  The get methods are called several times, while the set methods are NEVER called! This here may be the problem!

Revision history for this message
Bruno Nova (brunonova) wrote :

I've looked at the code again and I finally found what causes this bug!

From Raring to Saucy, there were these changes to the file softwarecenter/config.py:

33c33
< class SoftwareCenterConfig(object, SafeConfigParser):
---
> class SoftwareCenterConfig(SafeConfigParser):
38d37
< object.__init__(self)

The Software Center is executed using Python 2 (still?), so this changes the class from a "new style class" to an "old style class", I think. It seems Python properties don't work correctly in "old style classes".
Reverting these changes fixes the issue.

I've attached a patch that fixes the issue by reverting the changes.
I've tested this by editing the installed code directly and running software-center. The settings are now saved correctly and I haven't noticed any other new issues.
(By the way, I don't know if the line "object.__init__(self)" is really needed.)

---

However, I researched a bit to find why this change was made and, apparently, it was to fix a bug.
The changes were introduced in revision 3308 of lp:software-center by Rodney Dawes to fix bug LP:1038429 .
Software Center hasn't crashed for me, but I have apport disabled (the large number of crash reports in the first weeks of Saucy were too annoying).

So, someone with more knowledge about the code should look into this.

Revision history for this message
Bruno Nova (brunonova) wrote :

Oh, I forgot.
I created and tested the patch in Saucy.
But, as the code of softwarecenter/config.py hasn't changed in trusty/development, it should work for trusty as well.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix_settings_not_saved.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Donarsson (benjamin-schwarz) wrote :

I tested the patch in Trusty and it definitely solves the problem. Until now, everything works without crashing.

Changed in software-center (Ubuntu):
assignee: nobody → Rodney Dawes (dobey)
dobey (dobey)
Changed in software-center:
status: New → In Progress
assignee: nobody → Rodney Dawes (dobey)
Changed in software-center (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-center - 13.10-0ubuntu3

---------------
software-center (13.10-0ubuntu3) trusty; urgency=medium

  * debian/patches/03_bzr-save-settings.patch:
    - Fix parent object initialization chaining. (LP: #1244493)
 -- Rodney Dawes <email address hidden> Fri, 21 Mar 2014 14:06:18 -0400

Changed in software-center (Ubuntu):
status: In Progress → Fix Released
dobey (dobey)
no longer affects: software-center
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.