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 the url we send to the follow button in Full Post View #3418

Merged
merged 7 commits into from
Feb 24, 2016

Conversation

blowery
Copy link
Contributor

@blowery blowery commented Feb 19, 2016

This still has a big problem: the following state will be correct on load, but when the first page of results come in from the subscription sync, the following state will be dropped.

We need to change how we consume pages of subs in the feed-subscription-store, merging the page with current results, and possibly resorting the results by sub date.

@blowery
Copy link
Contributor Author

blowery commented Feb 19, 2016

Repro'ing this is "fun".

To see it, you have to have an account with at least 50 subs, preferably around 1000. Find a one of the first things you subscribed to, open the feed steam, then open a post into full post view.

Reload full post view.

Watch the follow button start off correct, then flop to the unfollowed state, then flip back to followed once the subscription loads in the background.

@blowery blowery added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Reader The reader site on Calypso. labels Feb 19, 2016
@blowery blowery added this to the Reader: UI Nits milestone Feb 19, 2016
@blowery blowery self-assigned this Feb 19, 2016
@blowery
Copy link
Contributor Author

blowery commented Feb 19, 2016

cc @bluefuton as he may have some insight on how to best fix this

@blowery
Copy link
Contributor Author

blowery commented Feb 19, 2016

flipper-the-button

@bluefuton bluefuton force-pushed the fix/follow-button-in-full-post branch from 005e9c1 to da28870 Compare February 22, 2016 23:32
@bluefuton
Copy link
Contributor

Rebased and forced.

I have around 270 feeds and I'm able to repro with one of my early subscriptions, http://calypso.localhost:3000/read/post/feed/44902/935964996. Digging into it now.

};
}
forEach( subscriptionsWithState, function( subscription ) {
addSubscription( subscription.toJS(), false );
Copy link
Contributor

Choose a reason for hiding this comment

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

The toJS() isn't ideal, but addSubscription() currently expects a plain JS object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oof. that's a lot of mutations.

@bluefuton
Copy link
Contributor

The fix here is to run new pages of subscriptions through addSubscription() rather than updating the subscriptions list directly. addSubscription() looks for subs that already exist in the store, and updates the existing sub if it finds one. e14980d remedies the 'followed-unfollowed-followed' flip you found @blowery.

@blowery blowery 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 Feb 23, 2016
@bluefuton
Copy link
Contributor

Todo:

forEach( subscriptionsWithState, function( subscription ) {
addSubscription( subscription.toJS(), false );
} );
subscriptions.list = subscriptions.list.asImmutable();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we need to tease out what addSubscription actually does into a helper.

@bluefuton
Copy link
Contributor

Looks good on the whole, but I found one odd quirk. After viewing a full post for an existing sub, it now pops to the top of the sub list (as seen in Manage Following):

https://cloudup.com/ch5LvM8iKxh

@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 Feb 24, 2016
@blowery
Copy link
Contributor Author

blowery commented Feb 24, 2016

Ah, nice catch. Looks like we need to sort the list on sub date client side after accepting new subs

blowery and others added 6 commits February 24, 2016 13:59
This still has a big problem: the following state will be correct on load, but when the first page of results come in from the subscription sync, the following state will be dropped.

We need to change how we consume pages of subs in the feed-subscription-store, merging the page with current results, and possibly resorting the results by sub date.
…ubscription() to ensure existing subs are updated correctly
This still needs refactoring, but good enough for now.
@blowery blowery force-pushed the fix/follow-button-in-full-post branch from f6e60d9 to cf47b98 Compare February 24, 2016 18:59
@blowery
Copy link
Contributor Author

blowery commented Feb 24, 2016

Rebased and repushed. Working on fixing the bump to top.

@blowery blowery 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 Feb 24, 2016
@blowery
Copy link
Contributor Author

blowery commented Feb 24, 2016

OK, ready for review again @bluefuton :)

@bluefuton
Copy link
Contributor

Cool! 👀

@bluefuton
Copy link
Contributor

That's done the trick. 🚢

@bluefuton bluefuton 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 Feb 24, 2016
blowery added a commit that referenced this pull request Feb 24, 2016
Reader: Fix the url we send to the follow button in Full Post View
@blowery blowery merged commit 2775437 into master Feb 24, 2016
@blowery blowery deleted the fix/follow-button-in-full-post branch February 24, 2016 21:31
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. [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants