-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Feat : Add download update feature in user app. Issue #755 #782
base: main
Are you sure you want to change the base?
Feat : Add download update feature in user app. Issue #755 #782
Conversation
Hi @abrichr Now why should we do this and not automatic update? As this is an Industry standard. No app downloads the updates on every start as :
So this comment was the best solution and i have implemented that. I have also added a video in the description showing how the feature works. |
@shashank40 this a great start! In the comment you linked, the third step is:
If you implement this we can consider this. Keep going! |
@abrichr I think that is the only part left in the comment. But i will implement the unzipping part for sure. |
@shashank40 typically how applications handle this is to say something like:
We can show a message on startup indicating that a new version is available, and let the user decide how to proceed. |
@abrichr Why i say this is, as OpenAdapt gets latest updates quite frequently(sometimes even 2-3 a day) and not weekly/monthly. So let's say i update it once and then few hours later there would be another popup hindering me. This would be a bad user experience every time i open an app. The implementation that you suggested might work better for apps/softwares that have scheduled updates that come weekly/monthly. But with these frequent updates, our user experience will go down. |
It's an interesting point @shashank40. But I still think we want to make the user's life easier by automatically extracting the application for them if they do choose to update. |
@abrichr You mean extracting the zip file? |
@abrichr Done. |
eefa958
to
723d115
Compare
@shashank40 I'm unable to test this on my machine because of #785. Can you please record a video showing the updated functionality? |
@shashank40 if you can upload a video showing this working, address my comments, and fix the formatting issues causing the build to fail, then I think we can get this merged! |
Surely @abrichr , will update this in sometime. Currently AFK. |
20624a0
to
869d88e
Compare
Hi @abrichr. I have replied back to the comments. I am also adding a new video here. In the video you can see the latest version now shows as 0.34.0 and in yesterday's video it was 0.33.2 and so this makes the app quite reactive to new updates. That will be the beauty of this new update. Dynamically telling you the latest version available. This is a full video of download process so from start till 3:30 mins it mostly shows download > then it shows unzipping > then it shows the unzipped new version available for the user. screen-recording-2024-06-20-at-103012-pm_aXnlm7SD.mp4 |
869d88e
to
d1c2604
Compare
c6e12dc
to
8f4aea0
Compare
Hey @abrichr can we go ahead and merge this? |
@abrichr any update on this? |
Hi @shashank40 , this looks good. However it's unfortunate that there is no visual indicator for the user about the progress, other than what is in the terminal (users who run the app not from the terminal won't see any progress). I think we need some sort of status indicator, e.g. via |
openadapt/app/tray.py
Outdated
import requests | ||
import threading | ||
from tqdm import tqdm | ||
import time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import requests | |
import threading | |
from tqdm import tqdm | |
import time | |
from tqdm import tqdm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this with isort
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @shashank40 ! Almost there.
openadapt/app/tray.py
Outdated
self.download_complete.emit("Download & Unzipping Complete") | ||
except Exception as e: | ||
logger.error(e) | ||
self.download_complete.emit("Download Failed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect this message to be symmetrical to the success case, e.g.:
"Download & Unzipping Complete"
...
"Download & Unzipping Failed"
Perhaps instead of Download & Unzipping
it can be simply Update
Also, should we rename download_complete
to e.g. update_complete
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abrichr In my opinion download is a better word. We haven't updated the app. We are downloading the latest update of the app. Updating would mean updating the current app they are using, which is not true.
openadapt/update_utils.py
Outdated
try: | ||
os.chmod(os.path.join(root, dir), 0o755) | ||
except PermissionError: | ||
print(f"Skipping directory due to PermissionError: {dir_path}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use logger
instead of print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
openadapt/app/tray.py
Outdated
@@ -107,9 +117,13 @@ class SystemTrayIcon: | |||
|
|||
# storing actions is required to prevent garbage collection | |||
recording_actions = {"visualize": [], "replay": []} | |||
download_complete = Signal(str) | |||
download_start_toast = Signal(str) | |||
unzipping_started_toast = Signal(str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding the suffix _signal
to each of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Hi @abrichr |
@abrichr any update? |
openadapt/app/tray.py
Outdated
"""Shows download start toast depending on emitted signal.""" | ||
self.download_progress_toast = self.show_toast( | ||
message, | ||
duration=DOWNLOAD_TOAST_UPDATE_TIME * 1000 - 50, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shashank40 can you please clarify why -50?
If this is due to some sort of race condition, what do you think about destroying the existing toast before displaying a new one? e.g. with self.download_progress_toast.hide()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yess @abrichr , it was to handle condition between spitting new toast and old toast times out by then.
But i have changed it to .hide()
Formatting fixes Formatting fixes Formatting fixes
Move unzip function to update_utils.py
Added toast post download complete Added toast post download complete
Fixed flake8
Added diable action + unzipping toast
c81087e
to
322cd6b
Compare
@abrichr Can you please do a final review? |
Thank you @shashank40. There appear to be a few loose ends:
I would like to merge this now, but as it currently stands, it's not very user friendly without these additions, i.e. once the extraction is complete, the user likely expects to be running the new version, even though currently they won't be. Once these additions have been implemented, the update feature will be complete and we can merge this. Thank you @shashank40 , almost there! Edit: implementation, courtesy of ChatGPT:
|
@abrichr I think we should not do part 1), reason is extraction takes 5-10secs. Now we already show toast when it starts and when extraction completes. The overhead and resource consumption to show extraction time left(which in turn is shown by 2 different toast) seems excessive. For 2, again i am less aligned. The things we are trying to implement happens in installed apps and not desktop apps which OpenAdapt is. I think we should compare OpenAdapt to Desktop Apps and not AppStore applications. In desktop apps, if we download 10 different ZIP files which have 10 different versions , they all stay and is manually deleted by the user if needed. A zip/unzipped file is never deleted by an app as this is being intrusive. It is always the decision of a user to delete the the file he downloaded manually.
Eventually its your take, but i would never install an app that can delete files from my personal computer. I would rather choose to delete a file manually(as it literally takes 1/2 a sec) than installing an app that can delete files. |
Thank you @shashank40 , I appreciate you presenting an alternative perspective. Regarding extracting the zip file: on my machine, it can take a while. The notification disappears before the extraction is complete, then it's not clear whether the process is complete or not. I think it's important we implement similar logic as for downloading to indicate the update is still occurring. Regarding not removing the old application, the intention here is to emulate the behavior of other applications that update automatically. For example, when I update Chrome, I don't have to remove the old directory. What do you think? |
@abrichr When comparing it to chrome, browsers are installed applications which have their own directory on the hard-drive and change required files when updated. So they never touch any other directory/downloaded file. Even if we download a multiple zips for chrome, they are never deleted by chrome. So installed apps work very differently in how updates work and how files are changed in their installed directory locations. OpenAdapt is a desktop app and not and installed app. It doesn't have a fixed directory like installed apps and so deleting files from any other directory needs higher level permissions and makes it unsafe. If OpenAdapt can delete files from any directory, it makes it unsafe. |
@abrichr updates? |
Hi @shashank40 , thank you for your patience.
We've implemented installers in #858. We would like the update functionality to work with the installed app. Edit: I know you're been at this one for a while. Almost there! |
/claim #755
What kind of change does this PR introduce?
Feature addition
Summary
Currently we don't support app update functionality in our app. With this addition, user can get the latest version of app from the app-tray itself.
Video
screen-recording-2024-06-19-at-43728-pm_NVMCrxmk.mp4
Checklist
How can your code be run and tested?
Other information