Faster thumbs#172
Conversation
Before, we it was possible to update the item without actually dispatching to the Redux state. This fixes this, in a very convoluted way.
It still could be better, but it's a lot better than before. Now we have some rate-limitting on thumbnail extraction, so hopefully we won't get 429s.
|
Hmm. This has a bug where thumbnails will show up as black boxes occasionally, even when we already have the thumbnails fetched and stored in the DB. Not sure why. Perhaps something to do with the thumbnail canvas caching? |
Oh; that may have been because of network throttling I had during testing. That would make more sense. |
Much more ergonomic to use a method fetch rather than pass it as the final argument of a long method.
This is more clean up work, should not have any functional change.
Non-functional change.
This adds a number of stricter static checks, as well as fixes for thumbnail parsing with redux ordering.
|
If you need some testing I'm here haha |
|
Always happy to have more testers! I found a few bugs from playing around with it, but so far it's been clean (and much faster). |
|
Testing this more, this feed: https://www.nicchan.me/feed.xml from Nic chan crashes Fluentflame Reader when this feature is merged. Stack trace: |
|
Ah, this is because that image hosting subdomain https://res.cloudinary.com/nicchan is dead. We should gracefully fail when we can no longer fetch thumbnails. |
|
The freezing present in #172 (comment) is not because of this PR, but rather a bug in the image cache where we can enter an infinite loop where the image fails to decode. Specifically, calling This is worth fixing in this PR too, I think. |
Previously, we had a bug where failing to decode an image would lead to an infinite loop as we kept trying to decode it over and over again. We don't actually need this, so keep track of failures.
|
I believe this is fully functional. If you do notice issues, please do let me know though! Things I'm specifically looking out for:
If you see any of those, they could be related to this feature. |
Implement lazy-loading for thumbnail fetching.
We give thumbnails exactly 1 second to load to prevent flashing, but after that we give up and let them load
in the background without waiting. This is implemented by keeping track of an item's
thumbnailJobs, andthen dispatching state/updating the DB on their completion.
Fixes #171.