wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.66k stars 1.11k forks source link

Reader: changes made to the Site Title, Tagline, and Site Icon are not reflected in the site stream header #14629

Open designsimply opened 4 years ago

designsimply commented 4 years ago

Steps to reproduce:

  1. Subscribe to and view a site you own in the Reader.
  2. Go to My Site, tap the Site Icon in the header, and change the image.
  3. Go to My Site, tap the Site Title in the header, and change the text.
  4. Go to My Site > Tagline, and add a very long tagline.
  5. Go back to the Reader and view the site there again.
  6. Pull to refresh.

Result: changes made to the Site Title, Tagline, and Site Icon are not reflected in the Reader site header. (1m43s, 1m4s)

IMG_4490 IMG_4491 IMG_4493

Tested with WPiOS 15.5.0.0 TestFlight beta on iPhone 11 iOS 13.6.

Can the cache for Site Title, Tagline, and Site Icon in the Reader header be updated when you pull to refresh?

designsimply commented 4 years ago

Here are some additional views in light/dark mode and in portrait/landscape orientation.

IMG_4499 IMG_4500 IMG_4498

IMG_0516 IMG_0517 IMG_0518 IMG_0519

Tested with WPiOS 15.5.0.0 TestFlight beta on iPhone 11 iOS 13.6 and iPad Mini 4 (WiFi) (iPad5,1) iPadOS 13.6.

yaelirub commented 4 years ago

Thanks for reporting @designsimply !

Hey @leandroalonso , got a CoreData question for you:

[step 1] When a user changes their site settings (title, tagline, icon etc’), we call: https://github.com/wordpress-mobile/WordPress-iOS/blob/b347ef8c2488401c1df006e548cc2d5aee42c8d8/WordPress/Classes/Services/BlogService.m#L357 That makes the updates and saves to the context.

[step 2] When we’re fetching a site topic in ReaderStreamController, we call siteTopicForSiteWithID in ReaderTopicService which calls: https://github.com/wordpress-mobile/WordPress-iOS/blob/106e032f0c6985a6c655f1a0e412b8570bd78232/WordPress/Classes/Services/ReaderTopicService.m#L1075 who uses a fetchRequest to get the topic from the main context but the fetch result doesn’t include the updates that were saved in [step 1].

What could be the reason for that? In my testing I found that the context in both is the same and that if I fetch the data for the site topic from the remote service, I do get the update so that's why I assume there's a context saving issue here.

leandroalonso commented 4 years ago

@yaelirub I guess this is not a Core Data issue.

When you tap to see a Blog's content controllerWithSiteID is called.

Then, siteTopicForSiteWithID in ReaderTopicService is called.

The problem is: once a topic is created for a blog, it never gets updated. Basically, it creates with the data it has and that's it.

I think we can either update the topic each time it's requested or grab the blog details from the first available post.

To correctly fix this, the posts should all refer to the same blog entity. But I'm afraid this would be disproportionally complex for a simple bugfix like this — we can still patch it though.

yaelirub commented 4 years ago

Thanks for looking into this, @leandroalonso ! @designsimply , as it is an edge case, I'm moving this issue to Groundskeeping.