#1042 closed defect (fixed)
cannot install new activity version
Reported by: | sascha_silbe | Owned by: | tomeu |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | |
Component: | Sugar | Version: | Git as of bugdate |
Severity: | Major | Keywords: | |
Cc: | eben, garycmartin | Distribution/OS: | Unspecified |
Bug Status: | New |
Description
After downloading the new version of Read Etexts (a later version was already installed) and clicking "Show in Journal", the following exception occured:
Traceback (most recent call last): File "/usr/lib/pymodules/python2.5/dbus/connection.py", line 214, in maybe_handle_message self._handler(*args, **kwargs) File "/home/sascha.silbe/sugar-jhbuild/install/lib/python2.5/site-packages/jarabe/journal/model.py", line 380, in _datastore_updated_cb updated.send(None, tree_id=tree_id, version_id=version_id) File "/home/sascha.silbe/sugar-jhbuild/install/lib/python2.5/site-packages/sugar/dispatch/dispatcher.py", line 125, in send response = receiver(signal=self, sender=sender, **named) File "/home/sascha.silbe/sugar-jhbuild/install/lib/python2.5/site-packages/jarabe/journal/journalactivity.py", line 250, in __model_updated_cb self._check_for_bundle(kwargs['tree_id'], kwargs['version_id']) File "/home/sascha.silbe/sugar-jhbuild/install/lib/python2.5/site-packages/jarabe/journal/journalactivity.py", line 283, in _check_for_bundle registry.install(bundle) File "/home/sascha.silbe/sugar-jhbuild/install/lib/python2.5/site-packages/jarabe/model/bundleregistry.py", line 330, in install raise AlreadyInstalledException AlreadyInstalledException
jarabe.model.bundleregistry.BundleRegistry.install() contains the following code:
if self.get_bundle(bundle.get_bundle_id()): raise AlreadyInstalledException for installed_bundle in self._bundles: if bundle.get_bundle_id() == installed_bundle.get_bundle_id() and \ bundle.get_activity_version() == \ installed_bundle.get_activity_version(): raise AlreadyInstalledException elif bundle.get_bundle_id() == installed_bundle.get_bundle_id(): self.uninstall(installed_bundle, force=True)
get_bundle() contains a similar loop like install() but only checks the bundle id, not the activity version. So install() will always fail with AlreadyInstalledException, even when we're trying to install a different version.
After removing the if self.get_bundle... several other errors came up, so can't verify this as the correct fix (yet).
Attachments (1)
Change History (8)
Changed 14 years ago by sascha_silbe
comment:1 Changed 14 years ago by sascha_silbe
- Keywords r? added
This patch fixes the tracebacks, but does not prevent activity installation each time a bundle containing an already-installed version is started from Journal. Will file a separate bug about that.
comment:2 Changed 14 years ago by tomeu
- Cc eben garycmartin added
I guess some stuff will break if we just let several versions of an activity be installed at the same time. AFAIR the idea was to only let users update to later versions until we have proper multiversion support.
Eben, Gary, thoughts on this?
comment:3 Changed 14 years ago by tomeu
- Keywords r- added; r? removed
Please put it back to the review queue once there's consensus on this. Thread:
http://lists.sugarlabs.org/archive/sugar-devel/2009-August/017801.html
comment:4 Changed 14 years ago by sascha_silbe
- Keywords r? added; r- removed
This is caused by an incorrect fix for #707. No new behaviour that needs to be discussed, just a simple regression (Daniel Drake confirmed this on sugar-devel).
We should re-check #707, though. It would be very nice for bundle-installed activities to simply override system ones (i.e. scan for user activities first and don't accept duplicates from system-installed activity location). Haven't dug into the code to see how easy it is to implement this, though.
comment:5 Changed 14 years ago by tomeu
- Keywords r! added; r? removed
I'm very confused, just downloaded Calculate 29 from ASLO, it installed fine. Then downloaded Calculate 30 and it updated fine. What's this bug about? Please update the title because "cannot install new activity version" doesn't seem to describe it well enough.
comment:6 Changed 14 years ago by sascha_silbe
- Keywords r! removed
- Resolution set to fixed
- Status changed from new to closed
Has been silently fixed by alsroot on 2009-07-30 in db6f095.
Only upgrading works now, downgrading fails (AlreadyInstalledException in shell.log, user remains in Journal without any error indication).
Fix upgrading of activities