wordpress-mobile / WordPress-Android

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

Reader: Get correct subscriber count for sites #9371

Closed rachelmcr closed 5 years ago

rachelmcr commented 5 years ago

Expected behavior

I expect the subscriber count on the site Reader feed in the app to match the count I see in the web Reader.

Actual behavior

The subscriber count doesn't always match what I see in the web Reader.

The discrepancy seems to be from the endpoint used. The web Reader seems to use the /read/sites/$site endpoint for sites (although it also distinguishes between the subscriber counts for sites and feeds) whereas the app is using /read/feed/$feed_url_or_id. For some reason those endpoints return different subscriber counts for the same site.

Steps to reproduce the behavior

  1. In the web Reader, go to the Search: https://wordpress.com/read/search
  2. Search for a site.
  3. In the search results, select and view the site feed. Note the subscriber count.
  4. In the app, open Reader > Search.
  5. Search for the same site.
  6. In the search results, select and view the site feed. Note the subscriber count.

For example, the en.blog.wordpress.com web feed: https://wordpress.com/read/feeds/25823

screenshot 2019-03-06 12 58 34

Compared to the app feed:

screenshot_20190306-125859

Tested on [moto e5 play], Android [8.1.1], WPAndroid [alpha-155]

h/t @charliescheer for the initial report (internal ref: p4a5px-2lS-p2)

rachelmcr commented 5 years ago

Note that the same issue occurs if you follow the site and view the site feed from your Followed Sites list.

This differs from the iOS behavior, which shows the correct subscriber count in that case.

rezzap commented 5 years ago

We have another report of this here it seems: 1859508-zen

The user recently changed the site address and after doing so the follower count in the app shows only 2 followers while the browser reader version shows the correct 2,338 followers.

charliescheer commented 5 years ago

another report here 2087171-zen

malinajirka commented 5 years ago

This is an interesting issue, but tbh I'm not sure what is the proper solution, since I don't know the history.

We get the subscribes count from three endpoints in the app:

  1. /read/sites/$site
  2. /read/feed/$feed_url_or_id
  3. /read/following/mine The subscribes counts from 1. and 3. seems to be in sync. However, the count from 2. tends to be higher 🤷‍♂ .

The logic in the app is pretty simple. If we have feed_id use the 2. endpoint. If we don't have feed_id use 1. endpoint.

The difference in the number of subscribers can be easily reproduced on Discovery blog. subscribers As you can see on the gif, we show different counts even within the app. Depending on whether you are looking at a site or a feed. Which from user's (and even mine) point of view are the same thing, but apparently there is a difference:).

All in all I believe this issue should be fixed on the server side. Unless I'm missing something, imho all three endpoints should return the same subscribers count.

Another solution is to stop using 2 endpoint, but I'm worried to make such change without completely understanding the context.

@nbradbury Do you by any chance remember some details which might help us resolve this issue? Thanks!

Update: I asked if it's expected behavior in p5PDj3-4MB-p2

nbradbury commented 5 years ago

Do you by any chance remember some details which might help us resolve this issue?

I remember that there were always issues with feeds vs sites, but I don't remember the details (it's been a while!). Probably best to ask in the Reader P2 or Slack channel (I'll send you links privately).

bluefuton commented 5 years ago

Thanks for reporting this @rachelmcr and for writing it up on +readersquad @malinajirka.

I've just shipped D31816-code which enables the /read/feed/ endpoints to return the site's subscriber count where available. The counts should now be consistent between the site and feed endpoints.