Ticket #442 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

After installing activity there are two icons in list and favorites view

Reported by: erikos Owned by: erikos
Priority: Immediate Milestone: 0.84
Component: sugar Version: Git as of bugdate
Severity: Blocker Keywords:
Cc: tomeu Distribution/OS: Unspecified
Bug Status: Resolved

Description

I installed using Browse. There is only one activity in ~/Activities I know that Sascha reported the same issue on irc.

Attachments

shell.log Download (38.3 KB) - added by erikos 4 years ago.
Logs from installing TypingTurtle

Change History

Changed 4 years ago by erikos

  • owner changed from marcopg to erikos
  • status changed from new to assigned

Changed 4 years ago by erikos

  • cc tomeu added

The add_bundle method in the bundleregistry get called twice - even though only one datastore entry is created. Actually the second time it gets called - it does so because our file monitor does report a change file_monitor_changed_cb

Changed 4 years ago by erikos

Logs from installing TypingTurtle

Changed 4 years ago by erikos

  • keywords r? added

This would do it.

diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
index 6a05734..62ac6e2 100644
--- a/src/jarabe/model/bundleregistry.py
+++ b/src/jarabe/model/bundleregistry.py
@@ -72,7 +72,15 @@ class BundleRegistry(gobject.GObject):
         if not one_file.get_path().endswith('.activity'):
             return
         if event_type == gio.FILE_MONITOR_EVENT_CREATED:
-            self.add_bundle(one_file.get_path())
+            try:
+                bundle = ActivityBundle(one_file.get_path())
+            except MalformedBundleException:
+                logging.error('Error loading bundle %r:\n%s' % (
+                        one_file.get_path(),
+                        ''.join(traceback.format_exception(*sys.exc_info()))))
+                return
+            if not self.is_installed(bundle):
+                self.add_bundle(one_file.get_path())
         elif event_type == gio.FILE_MONITOR_EVENT_DELETED:
             self.remove_bundle(one_file.get_path())

Changed 4 years ago by erikos

committed to get it in the snapshot:  http://git.sugarlabs.org/projects/sugar/repos/mainline/commits/ae381ce5b6be7f23602468e1a38fb9640a2af832

I leave it open for tomeu to comment if he likes the fix.

Changed 4 years ago by tomeu

Pushed a similar fix that doesn't need to access the disk:  http://git.sugarlabs.org/projects/sugar/repos/mainline/commits/92049568

Changed 4 years ago by erikos

  • keywords r? removed

Changed 4 years ago by erikos

  • status changed from assigned to closed
  • resolution set to fixed
  • status_field changed from Assigned to Resolved
Note: See TracTickets for help on using tickets.