manmal / hn-android

Hacker News client with a focus on reliability and usability.
https://play.google.com/store/apps/details?id=com.manuelmaly.hn
489 stars 160 forks source link

caching comments for articles where the total count is less than 150 #155

Closed peshkira closed 9 years ago

peshkira commented 9 years ago

Adding a work around for articles with many comments which cause the app the crash. The problem is that the current serialisation method writes the whole objects to a file instead of employing different serialisation strategies.

This causes the ObjectOutputStream.writeObject to throw a StackOverflowError due to the current model of the comments.

I tested a bit and it seems this happens for articles where the total comment count is > 150. As most of the articles have less comments anyway, this should be fine for now.

However, we will have to fix this properly in version 2.