We have a long sync operation in our program that shows a progress bar and gives the user an option to cancel. When they click they cancel button, they get a confirm dialog saying "Are you sure you want to cancel the sync?". Currently, while that dialog is on the screen, the sync keeps on running - it doesn't actually stop the sync until they click "Confirm".

What's the best approach for this situation? On the one hand it looks a bit strange for the sync to run, on the other, it wastes time to actually pause it.

  1. Pause the sync while the dialog is on the screen
  2. Keep the sync running but freeze the progress bar so it "looks paused"
  3. Keep the sync running and let the progress bar run


2 Answers 2


I would go for your first option:

  1. Pause the sync while the dialog is on the screen

Imagine this scenario: the user is syncing his personal information. Suddenly he realises that he chose the wrong folder, wrong files or that there are some files in that folder that he forgot were there. In this case the user definitely wants the information to stop uploading as soon as possible.

Also imagine the user presses the cancel button, the dialog appears but he doesn't press it immediately. On the meanwhile (this can be 1 second or 1 minute) the upload finishes.

What would happen in this situation?

  • Good answer as a general rule! For this particular program, the sync is hard coded against a data store. They don't "choose a folder" to sync with. Does that make a difference, or would you still actually pause it? Nov 20, 2016 at 19:38
  • @just.another.programmer Thanks. Could you elaborate "the sync is hard coded against a data store", please?
    – Alvaro
    Nov 20, 2016 at 19:41
  • The program syncs offline program data with a cloud version of the same data. When you open it for the very first time, you select your offline DB server. After that, it always syncs with your offline store. There's no "choosing a folder" or other possible mistakes. Nov 20, 2016 at 19:58
  • Although the user doesn't choose a folder, can he have a file or a string in a file he might realise he doesn't want on the server? I would try to analize the worst case scenario and see if it is worth stopping the process. And if stopping the process has any other bad side-effect.
    – Alvaro
    Nov 20, 2016 at 20:04

The best user friendly approach I can think of would be to allow the operation to continue while the dialogue is open, but not to let it complete unless no such dialogue was present.

In other words make the operation check to make sure no dialogue is active before completion, even if all the computational work has completed.

This way if it was accidentally hit by a cat or their big thumb (or big toe, don't ask) while they were away from thier Computer on a coffee grab or restroom break, when they return, they don't have to sit impatiently for it to resume.

This way it can also be canceled without worry that the operation would complete in the time it takes them to confirm that they want to cancel or not. (As if they hit the cancel button at 99% and the operation reaches 100% at the time the dialogue was ready to appear)

In most cases when syncing information the files are loaded into a temporary directory until the sync concludes and the files are verified. So if they decide they would not want those files uploaded, the cancelation would then prevent those temp files from being moved from the temporary directory and an operation to kill those particular files should be made (in the background in order to streamline the user experience and reduce wait time) so that those temporary files are deleted upon cancelation.

Best of luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.