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

fix(sync): keep up to date url and syncSupport in local storage #659

Merged
merged 9 commits into from
Nov 14, 2024

Conversation

nightnei
Copy link
Contributor

@nightnei nightnei commented Nov 13, 2024

Related issues

Proposed Changes

If user connected website and then something was changed on wordpress.com side - we don't reflect changes to appdata-v1.json.
With this PR we start doing it with url and syncSupport properties.
Later I will handle staging sites in the follow up PR.

Testing Instructions

  1. DON'T switch to this branch, it's necessary to do in 9-th step
  2. Open wordpress.com
  3. Purchase atomic website
  4. Open Studio
  5. Connect previously purchased website
  6. Open appdata-v1.json and assert that you see:
    1. "syncSupport": "syncable"
    2. "url": <YOUR_CORRECT_URL>
  7. Open wordpress.com, purchase a new domain and make it primary to your blog
  8. Open Studio -> Sync tab
  9. Assert that nothing changed in appdata-v1.json
  10. Switch to this branch and open Sync tab again
  11. Assert that you see:
    1. "syncSupport": "already-connected"
    2. "url": <YOUR__DOMAIN_FROM_6-TH_STEP>

@nightnei nightnei marked this pull request as ready for review November 13, 2024 16:04
@nightnei nightnei requested a review from a team November 13, 2024 16:07
Base automatically changed from nightnei/refetchSyncSitesOnOpeningTheDialog to trunk November 14, 2024 12:56

useEffect( () => {
if ( isAuthenticated ) {
refetchSites();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sejas maybe it's interesting for you, since you were working around fetching sites - before we were fetching sites every time when Sync tab opens, but after latest changes we don't do it any more, instead we fetch them during starting session. So I decided to refetch them when Sync tab opens, to keep data up-to-date. With this PR we are starting syncing data between Studio and wordpress.com, specifically url and syncSupport properties. Later I am going to sync staging sites, since adding/remicing them on wordpress.com doesn't reflect it in Studio.

Copy link

@stephanethomas stephanethomas left a comment

Choose a reason for hiding this comment

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

I don't have any particular comment about the code. I've tested those changes, and they work well. This is good to go for me 🚢.

@nightnei nightnei merged commit 335c634 into trunk Nov 14, 2024
15 checks passed
@nightnei nightnei deleted the nightnei/updateUrlAndSyncSupportInLocalStorage branch November 14, 2024 16:24
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.

2 participants