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 the app not being refreshed after disconnecting from WordPress.com in Jetpack Settings #19634

Merged
merged 6 commits into from
Nov 25, 2022

Conversation

staskus
Copy link
Contributor

@staskus staskus commented Nov 22, 2022

Fixes #19501

Description

When My Site → Jetpack Settings → Manage Connection → "Disconnect from WordPress.com button" is tapped, the site is not removed immediately causing subsequent errors.

Solution

  • Immediately delete a blog, instead of setting visible = false and waiting for an app refresh
  • Show loading indicator and don't allow to navigate back from the view while loading is happening, it allows avoiding the app ending up in an undetermined state
  • Additionally fix an issue with split view keeping the state when the last remaining blog is removed

Testing instructions

Test on both iPhone and iPad. Some specific changed were made to support split view

Case 1 Multi-site account (iPhone and iPad):

  1. Launch the WP app.
  2. Select a site with Jetpack plugin installed.
  3. Tap My Site → Jetpack Settings → Manage Connection → "Disconnect from WordPress.com button".
  4. Loading indicator should be shown
  5. The app should not respond to interactions
  6. After loading is done, the app should return to the main view and the main blog should be selected

Case 2 Single-site account (iPhone and iPad):

  1. Launch the WP app.
  2. Have a site with Jetpack plugin installed.
  3. Tap My Site → Jetpack Settings → Manage Connection → "Disconnect from WordPress.com button".
  4. Loading indicator should be shown
  5. The app should not respond to interactions
  6. After loading is done, the app should show "Create a site" message

Regression Notes

  1. Potential unintended areas of impact

Additional issues raising when immediately removing the site, instead of making it invisible and waiting for the refresh

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

Manual testing

  1. What automated tests I added (or what prevented me from doing so)

None

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Images & Videos

Single-site - iPhone

Jetpack.disconnect.-.single.site.-.iPhone.mp4

Single-site - iPad

Jetpack.disconnect.-.Single.site.-.iPad.mov

Multi-site - iPad

Jetpack.disconnect.-.Multi-site.-.iPad.mov
Blocking UI while while loading is in progress since navigating from this view controller during Jetpack connection or disconnection process can leave the application in an undetermined state.
Previously the blog was made not visible after disconnecting, however that leaves the app in the undetermined state until refresh happens
When all the blogs are removed, split screen details view should not have any view controllers set
In a case when the blog is removed when Jetpack view is opened, we don't need to reload the view if the blog no longer exists
@staskus staskus added this to the 21.3 milestone Nov 22, 2022
@staskus staskus marked this pull request as ready for review November 22, 2022 15:04
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 22, 2022

You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr19634-e0782c6 on your iPhone

If you need access to App Center, please ask a maintainer to add you.
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 22, 2022

You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr19634-e0782c6 on your iPhone

If you need access to App Center, please ask a maintainer to add you.
@salimbraksa salimbraksa self-requested a review November 23, 2022 12:34
Copy link
Contributor

@salimbraksa salimbraksa left a comment

Choose a reason for hiding this comment

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

LGTM! I left one suggestion about a minor typo. 🚀

Tests Done:

  1. I created a fake wordpress.com account and a self-hosted site using Jurassic Ninja
    • salimbraksademo.wordpress.com
    • nursing-marsupial.jurassic.ninja
  2. I launched WP app and signed into my wordpress.com account
  3. I disconnected the Jurassic site and the app returned to the main view and the other site was selected
  4. To simulate a single-site environment, I connected Jetpack plugin to the Jurassic site and deleted the wp.com site.
  5. I disconnected the Jurassic site and the app showed the "Create site message". ( and on iPad, the details screen was empty ).
…r.swift

Co-authored-by: Salim <salim.braksa@automattic.com>
@peril-wordpress-mobile
Copy link

Warnings
⚠️ This PR is assigned to a milestone which is closing in less than 4 days Please, make sure to get it merged by then or assign it to a later expiring milestone

Generated by 🚫 dangerJS

@staskus
Copy link
Contributor Author

staskus commented Nov 25, 2022

Thank you, @salimbraksa!

@staskus staskus merged commit c9213da into trunk Nov 25, 2022
@staskus staskus deleted the fix/19051-disconnect-from-wp.com-doesnt-work-properly branch November 25, 2022 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants