Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete the activity bundle after downloading and installation #100

Closed
wants to merge 1 commit into from

Conversation

nswarup14
Copy link
Contributor

Fixes #81
Changes

  1. downloadmanager.py

Updates
On downloading a new activity, from activities.sugarlabs.org, the activity bundle is installed and the activity bundle is deleted from the journal.

Reason why the activity bundle was being shown in the journal is that, it was never removed from journal before.
One side effect is that on deleting the activity bundle from the journal, the Show in Journal option returns immediately to the journal, and does not display the details of the activity.

Is there a way to remove the activity bundle from the journal, without losing the Show in Journal option.

Thanks

@quozl
Copy link
Contributor

quozl commented Jul 18, 2019

I'm confused. Which line of code installs the bundle?

@nswarup14
Copy link
Contributor Author

nswarup14 commented Aug 23, 2019

@quozl
Sorry for the late response.

I have been working on this since yesterday, and these are what I have found.

  • When an activity is being downloaded from activities.sugarlabs.org, the journal object is created by the self.create_journal_object method. As the download progresses, the journal entry is update by _update_progress handler.
  • Once the download is finished, the __download_finished_cb handler, updates the metadata for the journal entry created earlier, and writes it to the journal once again. This entry is the .xo activity bundle.
  • I'm not quite sure which line installs the activity, but it isn't just launch_bundle. I believe get_bundle also installs the activity. The reasoning is that get_bundle always returns None for me. I checked the shell.log after each download, the log file say that No bundle in activity.info. Yet the activity is installed and I can see it in the favourite view.
  • If the activity bundle is to be removed, the option of Show in Journal is no longer required. Show in Journal only works if the journal contains the entry, but if we are removing it after activity install, then the option has no meaning.

Kindly advise on how to proceed.

I feel the Show in Journal option be removed from the alert. I believe that it was added incase no bundle_id was returned to launch the activity from Browse directly.

Thanks

@quozl
Copy link
Contributor

quozl commented Aug 27, 2019

Thanks. Because this coded behaviour covers the toolkit, the Sugar shell, and the activity, we'll use the issue to discuss how to change it.

@quozl quozl closed this Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete activity bundle after download and install
2 participants