Skip to content

Conversation

oguzkocer
Copy link
Contributor

This PR integrates the new ListStore into the post list. I wanted to separate this into multiple PRs, but because the changes are all connected, my attempts at separating it didn't give satisfactory results. Either the changes separated are too small, doesn't give enough context or creates too much merge conflicts for little gain. Instead of swimming against the tide, I wanted to open this PR as is and only separate it if the reviewer asks me to do so. In exchange, I'll add a lot of line comments in the PR itself to make it easier to review this.

I am going to make a certain bot angry, but oh well 🤷‍. Onto the changes..


We have been unable to add filters or searching to post list for some time due to pagination issues it would have caused. I have been working in the FluxC land for some time implementing a set of components which not only avoids the pagination issues, but also provides an easy way to add filters, search, order by, order or pretty much anything you can think of. This PR is the first one that utilizes these new components and it's considered to be the v1 integration of it.

Testing Instructions

  • Test a self-hosted site as well as a .com one. You don't have to try all of this on both, but at least verify that basics work on both type of sites.

  • Don't forget to rotate the screen at times. There are some rotation issues from before, but this PR shouldn't add any new ones.

  • Use the emulator's "Cellular" settings to try a slower connection. (or take a subway ride 🤷‍) You don't have to test everything on a slow connection, but after you test everything on a fast connection, you can try the basics for a different site or after logging out and logging in on a slower one. If you slow the connection after everything is loaded once, it'll still load pretty fast, so won't be as useful of a test.

  • If you find any issues, if you can try out the production version (or develop) to see if you can replicate the issue (where applicable), it'd be very helpful. If you can replicate it, that means it's most likely a non-related issue, so open a new issue and ping me in it so I can have a look to see if I can fix it quickly in this branch. If you can't, please document it in this PR.

Testing Steps

Since this touches everything in post list anything that affects it should be tested. Here is a non-comprehensive list: (only because I can't think of all of it)

  • Do a fresh installation of the app (or logout/login) and visit the "Blog Posts" and check that it loads the posts.

A note on fresh installations: This will be only time the posts are loaded from scratch. After this, only the ids and modified dates of the post will be fetched, which means your subsequent visits or pull to refresh will be a lot faster and more bandwidth efficient (+90% difference on both of them in my tests)

  • Tap on a post and change the title or description and go back. The post should be updated and should say "Local changes".

  • Tap on a post, go to "Post settings" and add a featured image, tap on update button and check that it's reflected in the post list after a brief wait. (network request)

It looks like this doesn't work if the change only happens locally. Check #8472 for more details.

  • Tap on the floating button and create a draft by filling in title and/or content and going back. Check that it shows up in the list.

  • Disable your network, tap on the floating button and create a local draft by filling in the title and/or content. Check that it shows up in the list.

  • Re-enable your network and tap on publish on the remote draft you created 2 steps ago. Check that it's showing that it's uploading and it's refreshed after the upload succeeds.

  • Repeat the above step for the local draft you created.

  • If you have a site with more than 100 posts, use that and scroll as far as you can go. (or your as much as your patience allows) Check that more posts are loaded as you go and load more progress bar is visible at times. You can also overwrite the pageSize in PostListDescriptor in PostListFragment if you don't have a site with as many posts.

  • Change a post from another client. (Calypso, iOS etc) Pull to refresh the list and check that the post is updated in the post list.

  • Trash a post in the list and check that it's removed and a snackbar is shown to undo. Check that it's deleted in another client.

  • Trash a post in the list and tap on the undo bar to check that it's re-added to the list and it's not deleted from remote. (verify on remote after waiting a minute)

  • For bonus points, change the PostListDescriptorForRestSite or PostListDescriptorForXmlRpcSite by passing more parameters to it and try out different filters.


@malinajirka since you're leaving for a conference, I asked @kwonye for the review. If you do end up having time, you're welcome to review and/or test the PR, the more the merrier.