-
Couldn't load subscription status.
- Fork 51
Improve Push message when quitting #1919
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
base: trunk
Are you sure you want to change the base?
Improve Push message when quitting #1919
Conversation
📊 Performance Test ResultsComparing 4a55281 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
src/lib/active-sync-operations.ts
Outdated
| return ACTIVE_SYNC_OPERATIONS; | ||
| } | ||
|
|
||
| export function isRemoteProcessingStep(): boolean { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
LGTM, thanks!
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.
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? 🙏 |
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