Flutter_Installer icon indicating copy to clipboard operation
Flutter_Installer copied to clipboard

interrupt causing failure

Open yahu1031 opened this issue 3 years ago • 7 comments

hey @YazeedAlKhalaf @csells , I have found this issue long back but forgot to raise a issue here. when i wanna switch channels, and downloads the flutter zip, while extracting if any interrupt was happened it is corrupting the whole flutter files. hope you get a note of it. Regards.

yahu1031 avatar Sep 02 '20 03:09 yahu1031

@YazeedAlKhalaf ahh better make this also a critical thing. we have have a fix in future.

yahu1031 avatar Nov 03 '20 07:11 yahu1031

What kind of interrupt, can you provide reproduction steps?

YazeedAlKhalaf avatar Dec 22 '20 17:12 YazeedAlKhalaf

Steps to reproduce:

  1. Install flutter in your pc.
  2. Try installing another channel from this installer to your flutter installed folder, in my case, it is C:/src/. (If stable then try to install dev or beta).
  3. Wait till it gets to the extracting process.
  4. Now cancel it (during extracting).
  5. Try executing flutter command in your cmd or terminal/zsh.
  6. You will find it crashing.

This is the result when I try to change the channel(stable to master) image

yahu1031 avatar Dec 23 '20 05:12 yahu1031

So you mean that when you choose a directory in which flutter is in then the files are corrupted. So I believe the solution would be to add a check to see if the directory is empty or not. If not empty then tell the user to change the directory of the installation?

Tell me if I got you right.

YazeedAlKhalaf avatar Mar 03 '21 15:03 YazeedAlKhalaf

@YazeedAlKhalaf I know if we interrupt any process while upgrading or channel switching, it will also cause the same issue. But Our process must avoid that. To do that

  1. Backup the existing flutter(if exist only).
  2. Store a copy in our temp folder.
  3. When process get interrupt, then just remove the processed files and replace users old files and say user that process interruption may fail the process and we have restores your old files instead failing it.
  4. we even have custom -, X, [] icons too here.
  5. Do same functionality on X button also and then exit.

yahu1031 avatar Mar 03 '21 15:03 yahu1031

@YazeedAlKhalaf I know if we interrupt any process while upgrading or channel switching, it will also cause the same issue. But Our process must avoid that. To do that

  1. Backup the existing flutter(if exist only).
  2. Store a copy in our temp folder.
  3. When process get interrupt, then just remove the processed files and replace users old files and say user that process interruption may fail the process and we have restores your old files instead failing it.
  4. we even have custom -, X, [] icons too here.
  5. Do same functionality on X button also and then exit.

But won't ending task or closing just end the instance Flutter Installer.exe on Windows for example. How would we restore the directory, it would take time to restore so the user might just kill the app from Task Manager.

So I think checking if files exist we just do not install there as proposed in issue #5

What do you think?

YazeedAlKhalaf avatar Mar 03 '21 15:03 YazeedAlKhalaf

we must show some info about getting existing backup and restoring it to the user on both processes. If still the user don't want that then that is his mistake. Then errors will be raised and we must handle that too.

yahu1031 avatar Mar 03 '21 19:03 yahu1031