Skip to content
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

Split sync:pull into 2 steps #842

Merged
merged 12 commits into from
Jan 31, 2025
Merged

Split sync:pull into 2 steps #842

merged 12 commits into from
Jan 31, 2025

Conversation

ashfame
Copy link
Member

@ashfame ashfame commented Jan 24, 2025

Related issues

Proposed Changes

In this PR, we change the sync:pull operation to check the backup size before download to prompt user if they really want to continue in case of site being too large to push back again.

Screenshot 2025-01-24 at 22 55 35

"Cancel" halts the pull operation. "Continue" starts downloading the backup for restoration.

Also, added console log calls in a group:

Screenshot 2025-01-24 at 22 03 50

Testing Instructions

  • Restore a normal sized site (<2GB) and it would succeed exactly before the changes in this PR
  • Modify SYNC_PUSH_SIZE_LIMIT_BYTES to be really small so that normal size backup is also over the max limit
  • Try "pull" and you will see the prompt for Cancel/Continue

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

check backup size before download in sync:pull to prompt user if they really want to continue in case of site being too large to push back again
@ashfame ashfame requested a review from a team January 24, 2025 19:01
@ashfame ashfame self-assigned this Jan 24, 2025
Copy link
Contributor

@wojtekn wojtekn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flow looks good, and works as expected.

We could change 'Pulling changes' message as now it makes less sense that it made before. I would propose 'Initializing backup' instead.

@wojtekn
Copy link
Contributor

wojtekn commented Jan 28, 2025

@ashfame I noticed one issue while testing. When I get a large backup dialog and I decide to cancel, I get the alert when I try to quit Studio:

Screenshot 2025-01-28 at 10 24 10

@ashfame
Copy link
Member Author

ashfame commented Jan 28, 2025

@wojtekn Regarding the message when you try to close the app, that's cool. I am seeing it for the first time. Looks like functioning as it should. Can you elaborate the issue?

@wojtekn
Copy link
Contributor

wojtekn commented Jan 28, 2025

@wojtekn Regarding the message when you try to close the app, that's cool. I am seeing it for the first time. Looks like functioning as it should. Can you elaborate the issue?

It should alert users when they try to close the app while the sync is running. In my case, the sync was not running, but I still got an alert:

  1. Start a pull
  2. See the large site notice
  3. Click cancel (sync is not running anymore)
  4. Close the Studio
  5. Note that it displays the warning, but shouldn't

@ashfame
Copy link
Member Author

ashfame commented Jan 28, 2025

Ah I see, missed "sync was not running" part. Thanks for explaining!

@ashfame ashfame requested a review from wojtekn January 28, 2025 17:03
@ashfame
Copy link
Member Author

ashfame commented Jan 28, 2025

@wojtekn Fixed the false "sync in progress" alarm. Ready for review again.

@wojtekn
Copy link
Contributor

wojtekn commented Jan 29, 2025

Thanks @ashfame - it doesn't show the dialog when I try to close the app now.

Could you please improve dialog message formatting and adjust the label mentioned in the comment above?

We could change 'Pulling changes' message as now it makes less sense that it made before. I would propose 'Initializing backup' instead.

@ashfame
Copy link
Member Author

ashfame commented Jan 29, 2025

@wojtekn Sorry missed doing that, but done now.

@wojtekn
Copy link
Contributor

wojtekn commented Jan 30, 2025

Thanks @ashfame , they look consistent now:

Screenshot 2025-01-30 at 12 11 58

Screenshot 2025-01-30 at 12 12 36

Could you please change the label too?

We could change 'Pulling changes' message as now it makes less sense that it made before. I would propose 'Initializing backup' instead.

@ashfame
Copy link
Member Author

ashfame commented Jan 30, 2025

@wojtekn Sorry, I am not sure what label are you referring to? Got clarification in DM

Copy link
Contributor

@katinthehatsite katinthehatsite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good 👍

@ashfame ashfame merged commit 1f06c51 into trunk Jan 31, 2025
6 checks passed
@ashfame ashfame deleted the sync_pull_prompt_large_restore branch January 31, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants