Skip to content

Feature/support private at sites#11590

Merged
develric merged 58 commits intodevelopfrom
feature/support-private-at-sites
Apr 16, 2020
Merged

Feature/support private at sites#11590
develric merged 58 commits intodevelopfrom
feature/support-private-at-sites

Conversation

@khaykov
Copy link
Copy Markdown
Contributor

@khaykov khaykov commented Apr 6, 2020

This PR adds support for loading media from private Atomic sites.

Companion Flux-C PR needs to be merged first.

There are two main changes:

  • If the site is private atomic, we load Photon media using different base URL (media proxy). Most of the changes are related to this method.
  • We use a cookie to load media in Editor, Reader post details and site/post preview.

Since the use case for this is relatively small, I wanted to avoid adding too much new logic, and instead integrated the behavior into existing flow with (hopefully) minimal amount of interruption.

There are a couple of steps to test the changes:

  • Using a8c account and wpcalypso.wordpress.com (important) create a site with a business plan, perform AT by installing a plugin and set the site to private.
  • Using App, switch to the abovementioned site.

Site preview:

  • From MySite screen, preview the site on the web by tapping on the site name, or View Site button. You should be able to view the site.

Editor:

  • Create a new post, set a featured image to it and add an image to the post content. Publish the post.
  • View post from post list. It should be displayed correctly.
  • Open post in Block editor. The image in the post should be displayed correctly.
  • Open post in Aztec. The image in the post should be displayed correctly.

Reader:

  • Navigate to the reader, and select Following tab.
  • From subfilter select the private AT site we are testing.
  • Notice that the featured image in the post is displayed correctly in the reader post list.
  • Open the post details. Notice that the image in the post is displayed correctly.

When testing cookie authentication, you might encounter cookie loading with a modal dialog.
Cookie loading injects into normal content loading flow and interrupts it if necessary. Loading will continue as normal after the cookie is retrieved. A cookie Progress dialog is cancellable, and when canceled the normal flow of content render will resume.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • 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.

khaykov added 23 commits April 3, 2020 11:36
…/wordpress-mobile/WordPress-Android into feature/support-private-at-sites

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/PrivateAtCookieRefreshProgressDialog.kt
@khaykov khaykov added this to the 14.7 milestone Apr 6, 2020
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Apr 6, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Apr 6, 2020

You can test the changes on this Pull Request by downloading the APK here.

@khaykov khaykov marked this pull request as ready for review April 13, 2020 07:53
@develric
Copy link
Copy Markdown
Contributor

Hi @khaykov , was looking into this PR and was able to get the described scenarios to work correctly 👍; while looking into it I noticed the following and I thought to leave this quick note for you to double check.

In the Posts list, if I ask for a VIEW on a published post or for a PREVIEW on a draft post I get something like the following:

Let me know if I can help in reproducing in case it is setup specific 😊

@khaykov
Copy link
Copy Markdown
Contributor Author

khaykov commented Apr 15, 2020

Thank you, @develric ! A mistake on my part - I assumed Post preview is launched in the same way as site preview, but it's not. Added a private site id to post preview launcher, so it should work.

Also fixed issue where site preview was always behaving thinking that the site is private.

@khaykov
Copy link
Copy Markdown
Contributor Author

khaykov commented Apr 15, 2020

There is one hard to tackle issue - when you play with calypso settings while the app is open, the app can (and will) get out of sync with calypso. This affects all parts of our app, and I don't think there is much we can do at this point.

Copy link
Copy Markdown
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Hi @khaykov 👋! Thanks for the View/Preview modifications and for the additional follow up enhancements 🙇‍♂️!

Code LGTM; I've also tested:

✅ with AT private as per test steps
✅ View/Preview from posts list/editor
✅ with WP.com/JP/Pure self-hosted (no regression)
✅ Update script from previous version for wp-fluxc and wpreader DBs

and works as expected, good job 👍!

There is one hard to tackle issue - when you play with calypso settings while the app is open, the app can (and will) get out of sync with calypso. This affects all parts of our app, and I don't think there is much we can do at this point.

Agree this is a general issue and I noticed something similar related to the gravatar update sync in the app when changed from the web side, a wider scope thing we should think about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants