btmura/rbb

in subreddit view, tap on a post and tap back immediately. up/downvote icons becomes unresponsive

Closed this issue · 2 comments

e.g. got to s/worldnews
tap one of the posts
webpage starts loadintap back
try to upvote any post and note nothing seems to happen

This happens because everything except thumbnails is being scheduled on the AsyncTask.SERIAL_EXECUTOR thread pool. If you are loading something, clicking on the voting arrows schedules the operations, but the operations blocks waiting for the no longer visible content to load. We should use a separate thread pool for network operations and just use the serial executor for small operations that only manipulate the database. Voting just modifies the database, and the sync adapter later processes the votes on a separate thread. This definitely has to be fixed for 2.0.

It turned out the cause was due to a unintentional network call during a database transaction. Fixed after many refactoring CLs of the provider code.