Improve Push message when quitting - #1919
Conversation
📊 Performance Test ResultsComparing bec7259 vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change |
…dio-investigate-how-to-stop-a-rewind-or-display-a-warning
| return ACTIVE_SYNC_OPERATIONS; | ||
| } | ||
|
|
||
| export function isRemoteProcessingStep(): boolean { |
There was a problem hiding this comment.
Recently we merged another PR #1864 related to cancelling, push and pull operations.
We added similar logic to determine if the operation can be cancelled: https://github.com/Automattic/studio/blob/trunk/src/hooks/use-sync-states-progress-info.ts#L288
I think we could extract this logic to a util function.
There was a problem hiding this comment.
Thanks @bcotrim, I saw that after updating this PR. I will definitely have a look at the changes as they are related
There was a problem hiding this comment.
Great work @epeicher ! I really like the two different modals that set better expectations of what is the consequence of closing the app when uploading or when a restore is already in process.
I wonder if we should consider the edge case when the user tries to close the app just before the restore process starts, so the alert will display that will abort the process, but after a few seconds reading the modal, the upload will finish and the state will change to restore.
That's a good point, I have tested, and it can happen. When the dialog is displayed, the UI is not refreshed (new messages are not displayed), but the states continue to progress in the background. That could be addressed with another message, but it will be a "double dialog" scenario: one dialog appears when closing the first. We can adapt the text in that case to be something like "Sorry, the process has progressed to a non-cancellable step" or similar, but those double dialogs are a bit annoying. What do you think? |
|
@sejas @epeicher that's a nice catch and a likely scenario. We might be going into a rabbit hole, but we could add a |
|
The pause logic seems like the more solid implementation. Let me know if it becomes a rabbit hole. |
|
HI @sejas, @bcotrim, after some iterations trying to implement the So in summary, if the user opens the dialog, the renderer process will not progress to the next Could you please test the changes again and let me know if you find any issues? 🙏 |
…dio-investigate-how-to-stop-a-rewind-or-display-a-warning
The Pull process was using the wrong message
bcotrim
left a comment
There was a problem hiding this comment.
LGTM 👍
I retested and confirm what you described. From what I could tell the operation is paused until the alert is closed.
sejas
left a comment
There was a problem hiding this comment.
Thanks for applying the changes 👍
That's a tricky scenario as it depends on a request that is in flight. That will depend on the time the cancel button is pressed or Studio is closed. Currrently, the cancel button does not have an AbortController for that request so I guess it was conservative in not allowing the user to cancel at that point (originally implemented here #1864). In the case of the dialog message, I decided to be consistent with the cancel button, but I am happy to investigate other alternatives. One crucial detail is that a request in flight can be aborted, but I don't think it can be paused, so when the user sees the dialog, if it takes some time to click the button, the request could complete during that time and the process continues remotely. If alternatively, the user presses the quit button in the dialog before the request completes, the active request is aborted and the process stops. |
Issues attributed to commits in this pull requestThis pull request was merged and Sentry observed the following issues:
|


Related issues
Proposed Changes
There's a sync operation in progress. The process will continue on WordPress.com servers even after quitting Studio. We will send you an email when it completes. Are you sure you want to quit?Note
The alignment of the dialog contents to the left is happening in
trunkand it might seem related to the Electron version or the OS design changes, but it is not related to this PRTesting Instructions
npm startCreating backup…state, the modal displays the previous messageThere's a sync operation in progress. Quitting the app will abort that operation. Are you sure you want to quit?Uploading Studio site…onwardsThere's a sync operation in progress. The process will continue on WordPress.com servers even after quitting Studio. We will send you an email when it completes. Are you sure you want to quit?Pre-merge Checklist