-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
@samouri This PR needs a rebase |
d7d1ab1
to
457d22e
Compare
searchResults: getReaderFeedsForQuery( state, ownProps.sitesQuery ) || [], | ||
searchResults: map( | ||
getReaderFeedsForQuery( state, ownProps.sitesQuery ) || [], | ||
item => omit( item, 'URL' ) // the feed searching gives different urls than /following/mine. |
There was a problem hiding this comment.
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"
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: |
@blowery: I didn't see |
@bluefuton nice spot! |
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( |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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 :)
70b2bd8
to
a04fbdf
Compare
@blowery: i've updated this to use 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? |
done, its much nicer and explicit 👍 |
@samouri broke the tests. :) |
Should be good now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 fromfollowing/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: