Wp-calypso: Reader: Re-adding a feed leaves you stuck on the loading placeholder

Created on 19 May 2017  路  12Comments  路  Source: Automattic/wp-calypso

Steps to reproduce

  1. Starting at URL: https://wpcalypso.wordpress.com/following/manage
  2. Add a feed you're already following

What happened

It's not able to determine whether you're already following that site (follow button is still blue):
screenshot 2017-05-19 08 43 41

Once you hit follow, the loading placeholders are added to the very top of the list and it's just stuck there...
screenshot 2017-05-19 08 44 07

... even if you clear the search:
screenshot 2017-05-19 08 45 22

If you add a new site, this site gets added after the loading placeholders:
screenshot 2017-05-19 08 46 53

Reader [Pri] High [Type] Bug

Most helpful comment

馃憤 The API patch solved the placeholder issue. There's room for some nicer feedback for the user or fuzzy URL matching like #14369, but I reckon the original problem is fixed.

All 12 comments

Strange. its working in some cases and broken in others:

working

  • daringfireball.net

broken

  • jancavan.com

It'll probably be a fix in the reducer. I'll investigate

Looks like it's failing to pick up a feed ID or blog ID when this happens:

screen shot 2017-05-22 at 14 37 50

I think this is happening when there's a discrepancy between the feed URL in Feedbag, and the one the user has entered. Jan's site has two entries:

screen shot 2017-05-22 at 15 52 33

When we hit read/feed looking for `http://jancavan.com', we don't get anything back.

I'm not sure how yet, but I believe this issue may be due to a stale redux cache. clearing IndexedDB removed this issue entirely for me.

Scratch what I said earlier. I can repro it even after a cache clear.

Heres what I think the issue is:

  1. One requests to follow jancavan.com
  2. api responds with:
{
  "already_subscribed": true,
  "subscribed": true
}

What we would like the reducer to be able to do in this case is to then remove the new entry in the case of already_subscribed. It then also needs to realize that jancavan.com is an alias for a different feed_URL so that it can show the follow button status properly. We dealt with a variant of this situation recently for when someone types in an external rss feed and the actual feed url is different than what was typed in. That means the api response feed_URL was different than the initially assumed one.

We solved this in the follows reducer within READER_FOLLOW case by recognizing when actualFeedUrl is different and then changing its key + adding in a list of url aliases.

A clean way forward could be to simply add the feed_URL in to the api response, and things should just work without any further changes.

@bluefuton, you were right about the feedId/blogId being missing! The data-layer gets nothing it considers to be part of the sub object from the api response except for the url in the initial request payload + the fact that its subbed.

It then dumbly forwards that to the reducers even though its missing essential data. https://github.com/Automattic/wp-calypso/issues/14281#issuecomment-303237738 should fix it though.

I think this is happening when there's a discrepancy between the feed URL in Feedbag, and the one the user has entered.

nailed it! another condition is that the user has to already be following it. For the case where the user doesn't follow it yet we've already solved the issue :)

Jan's site has two entries:

not sure if this ties in to the issue but it is strange.
I don't think is mergeable either because they are both canonical right?
edit: i think this is standard wp behavior

The API patch D5693 should help a bit. It should ensure a subscription object gets handed back (even when already_subscribed) so the data layer can compare the request and response URLs.

I think the important bit is solved right @bluefuton? anything else blocking?

If all thats left is discovering that you already follow it before hitting the follow button, then I think we should close it. It isn't solvable just yet even though this may help it: https://github.com/Automattic/wp-calypso/pull/14369

馃憤 The API patch solved the placeholder issue. There's room for some nicer feedback for the user or fuzzy URL matching like #14369, but I reckon the original problem is fixed.

I'm not seeing the placeholder issue anymore, but it's displaying the "no sites" error message as well as the Follow button? @samouri @bluefuton

screenshot 2017-05-24 12 54 40

its an edge case one layer deeper :)

It happens when a user:

  • performs a site search
  • there are no search results
  • we've deduced it actually exists because they already follow it

what should we display?

Oh I see, I know I suggested it here: https://github.com/Automattic/wp-calypso/pull/14013#issuecomment-301613399, but my expectation was that once we already know this site exists, we no longer display the error message.

Was this page helpful?
0 / 5 - 0 ratings