wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.98k stars 1.32k forks source link

Site Settings: changes to "Lazy load images" setting aren't saved #11021

Closed designsimply closed 4 years ago

designsimply commented 4 years ago

Steps to reproduce:

  1. Go to My Site > Settings, scroll until you find "Lazy load images" setting.
  2. Toggle the "Lazy load images" setting on.
  3. Tap the back arrow (top left).
  4. Re-open settings and check to see if the "Lazy load images" setting is still on.

Result: the "Lazy load images" setting cannot be saved to on. (20s WP.com, 23s WP5.2.3 JP8.0)

Screenshot_20191223-125657

Tested with WPAndroid 13.9-rc-1 on Pixel 3 Android 10.

malinajirka commented 4 years ago

I've quickly looked into this issue and I found the following:

Any of "lazy load images", "Site accelerator - faster images, faster static files" don't work on WPCom sites (including AT sites). However, it works on a self-hosted site with installed and activated JetPack.

It seems the issue is on this line => mSite.isJetpackConnected() returns true only for a self-hosted site with JetPack (the user needs to be logged into the app with the same wpcom account they used for JetPack), therefore it's the only scenario when we push the changes to the server.

I don't have enough context to suggest an appropriate fix. We might want to hide the settings unless the user is logged in with the wpcom account connected to jetpack + we somehow want to make sure we push the changes even on wpcom sites 🤷‍♂. @khaykov Do you by any chance have more context about this feature?

SideNote:

Result: the "Lazy load images" setting cannot be saved to on. (20s WP.com, 23s WP5.2.3 JP8.0)

The WP.com video corresponds to my findings. The WP5.2.3 JP8.0 doesn't correspond to my findings, however I believe the Jetpack wasn't activated (connected to your wpcom account) or you weren't logged into the app with the wpcom account. (I don't see "Plugins" in the My Site section which would confirm this theory) @designsimply Can you please confirm this? Thank you!

designsimply commented 4 years ago

The WP5.2.3 JP8.0 doesn't correspond to my findings, however I believe the Jetpack wasn't activated (connected to your wpcom account) or you weren't logged into the app with the wpcom account. (I don't see "Plugins" in the My Site section which would confirm this theory) @designsimply Can you please confirm this?

I re-tested, and you are correct! I used a WordPress 5.3.2 site with Jetpack connected in a new test while logged in to the app as the connected user at the time of the test and the lazy load images setting stays saved as expected in that case: 17s.

khaykov commented 4 years ago

@malinajirka , sorry, no idea how that feature was implemented 🤷‍♂

malinajirka commented 4 years ago

@designsimply I think the best next step would be putting this into the prioritized Groundskeeping column.

For reference: This is the PR where the feature was introduced - https://github.com/wordpress-mobile/WordPress-Android/pull/10468

designsimply commented 4 years ago

Will do. 👍