Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader: fix feed searching having incorrect following state #13351

Merged
merged 6 commits into from
Apr 28, 2017

Conversation

samouri
Copy link
Contributor

@samouri samouri commented Apr 24, 2017

Barely a bug since it on an unreleased product.

In Search on Manage, search result items don't have the correct following status. This is due to the api returning url differently from following/mine.

feed-search --> ?
Following/mine --> feed_URL

The fix was just ignoring the url from feed-search and using the one found on a the feed/site.

To Test:

  • head to the live branch, search for a feed you are already following, it should be green.
  • clicking the urls below list items should open the website in a new tab (not the rss feed)

@samouri samouri self-assigned this Apr 24, 2017
@matticbot
Copy link
Contributor

@matticbot matticbot added the [Size] S Small sized issue label Apr 24, 2017
@samouri samouri added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Apr 24, 2017
@matticbot
Copy link
Contributor

@samouri This PR needs a rebase

@samouri samouri force-pushed the fix/reader/feed-search-following-status branch from d7d1ab1 to 457d22e Compare April 25, 2017 15:46
searchResults: getReaderFeedsForQuery( state, ownProps.sitesQuery ) || [],
searchResults: map(
getReaderFeedsForQuery( state, ownProps.sitesQuery ) || [],
item => omit( item, 'URL' ) // the feed searching gives different urls than /following/mine.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add "so we omit it and use the URL from the feed/site instead"

@bluefuton
Copy link
Contributor

This hasn't done the trick for me @samouri. I'm following this feed, Awful Library Books:

http://calypso.localhost:3000/read/feeds/63937159

...but its following state isn't reflected:

screen shot 2017-04-26 at 14 27 15

@bluefuton bluefuton added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 26, 2017
@matticbot matticbot added [Size] M Medium sized issue and removed [Size] S Small sized issue labels Apr 26, 2017
@samouri samouri added [Size] S Small sized issue [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Size] M Medium sized issue [Status] Needs Author Reply labels Apr 26, 2017
@samouri
Copy link
Contributor Author

samouri commented Apr 26, 2017

@blowery: I didn't see subscribe_URL in the api response even though the reducer tests make me think it should be there 🤔

@samouri
Copy link
Contributor Author

samouri commented Apr 26, 2017

@bluefuton nice spot!
It was a case that I hadn't realized when initially writing the ReaderSubscriptionListItem. The siteUrl vs. feedUrl distinction.

@samouri samouri added [Status] In Progress and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 26, 2017
@matticbot matticbot added [Size] M Medium sized issue and removed [Size] S Small sized issue labels Apr 26, 2017
@samouri samouri added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Apr 26, 2017
searchResults: getReaderFeedsForQuery( state, ownProps.sitesQuery ) || [],
// the feed searching gives different urls than /following/mine.
// therefore we decide to omit it and use the feed_URL from the feed/site
searchResults: map(
Copy link
Contributor

Choose a reason for hiding this comment

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

if we're going to do this, it should be in a memoized selector, not here. This runs every time the redux store updates and would return a new instance of searchResults on each run. That would cause the connected component to always rerender...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call. I'm still 🤞 on the api fix though :)

@bluefuton bluefuton added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 27, 2017
@samouri samouri force-pushed the fix/reader/feed-search-following-status branch from 70b2bd8 to a04fbdf Compare April 27, 2017 18:17
@samouri samouri added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Author Reply labels Apr 27, 2017
@samouri
Copy link
Contributor Author

samouri commented Apr 27, 2017

@blowery: i've updated this to use subscribe_url. The solution works (i think) but its not as clean as i think it could be.

What do you think about adding in feed_URL to the data-layer for both follows+feedSearches? (not the api, the normalization of the response)

@blowery
Copy link
Contributor

blowery commented Apr 27, 2017

What do you think about adding in feed_URL to the data-layer for both follows+feedSearches? (not the api, the normalization of the response)

Sounds fine. My first thought was that we'll need to update the schema for follows, but I'm not sure we have a schema for follows just yet?

@samouri
Copy link
Contributor Author

samouri commented Apr 27, 2017

done, its much nicer and explicit 👍

@blowery
Copy link
Contributor

blowery commented Apr 27, 2017

@samouri broke the tests. :)

@blowery blowery added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 27, 2017
@samouri samouri added [Status] Ready to Merge [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Author Reply [Status] Ready to Merge labels Apr 28, 2017
@samouri
Copy link
Contributor Author

samouri commented Apr 28, 2017

Should be good now!

@blowery blowery added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 28, 2017
Copy link
Contributor

@blowery blowery left a comment

Choose a reason for hiding this comment

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

LGTM

@samouri samouri merged commit 3e17f08 into master Apr 28, 2017
@samouri samouri deleted the fix/reader/feed-search-following-status branch April 28, 2017 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Reader The reader site on Calypso. [Size] M Medium sized issue [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants