lo-cafe / winston

A beautiful and native Reddit client for iOS
https://winston.cafe/
GNU General Public License v3.0
672 stars 51 forks source link

[BUG] Duplicate subreddits on the home page #491

Open IsaacKhor opened 2 months ago

IsaacKhor commented 2 months ago

Describe the bug

Duplicate entries in the subreddit and multireddit list of the main page. Not sure how to reproduce; it persists through reboots but didn't happen when I added my alt account.

To Reproduce

Unsure; it happened on adding my 1st account. 2nd account did not exhibit this behavour. Refreshing and quit/relaunch did not fix the behaviour.

Expected behavior

No duplicate entries.

Screenshots

image

Winston (please complete the following information):

Device (please complete the following information):

linear[bot] commented 2 months ago

WIN-142 [BUG] Duplicate subreddits on the home page

ojsef39 commented 2 months ago

Hi @IsaacKhor have you tried to clear the cache? (Settings -> General -> Advanced)

Maybe that resolved the issue for you :)

iiTzRichie commented 2 months ago

Have you tried to clear the cache? (Settings -> General -> Advanced)

I've had it happen to me too (on Alpha), and like they said, I also am not sure how it happened/how to reproduce, however, clearing the cache does fix it, I can confirm.

ojsef39 commented 2 months ago

I've had it happen to me too (on Alpha), and like they said, I also am not sure how it happened/how to reproduce, however, clearing the cache does fix it, I can confirm.

Good to know thanks for trying! Hopefully we find a way to reproduce this :)

IsaacKhor commented 2 months ago

Yeah looks like clearing the cache fixed it. Wish I got a dump of it before I cleared it, but too late now :/

A few more interesting characteristics: selecting a duplicated entry will highlight all duplicate entries before transitioning to the subview. Not an iOS dev, but skimming through the code looks like https://github.com/lo-cafe/winston/blob/3e39da290458c38daca68fb7c741c585d099ecae/winston/views/Subreddits/Subreddits.swift#L174 is the place responsible, and probably https://github.com/lo-cafe/winston/blob/3e39da290458c38daca68fb7c741c585d099ecae/winston/views/Subreddits/Subreddits.swift#L31 got dupe entries somehow. Might be worth doing a cache integrity check on change or launch, and invalidate if it seems fishy.