SimonHalvdansson / Harmonic-HN

Modern Android client for Hacker News

Home Page:https://play.google.com/store/apps/details?id=com.simon.harmonichackernews

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HN API not always used for comment order

rantoforest opened this issue · comments

Hello , Dev
Default order of comments is different on some submissions like this
https://news.ycombinator.com/item?id=22400375
Screenshot_20231005-225633
Screenshot_20231005-225703

and this
https://news.ycombinator.com/item?id=21332072
Screenshot_20231005-225831
Screenshot_20231005-225906

I think this is similar to #52 and it has been made live in the meantime.

It is actually not. The issue here is that when a story is loaded from the Algolia API (such as when searching), we never get any data from the HN API about the ordering of comments and have to make a guess. The solutions would be to hybridize the loading by, when opening a story with no HN info, immediatelly calling the HN API to get the comment order and hope that data comes in before the Algolia comments.