Awful / Awful.app

Something Awful Forums browser for iOS
https://forums.somethingawful.com/showthread.php?threadid=3837546&perpage=40&noseen=1
136 stars 45 forks source link

No more duplicate smilies on the keyboard #1090

Closed dfsm closed 3 years ago

dfsm commented 3 years ago

There was an issue with the original loop and matching the smilie text values. For some reason scraped isEqualToString:known wasn't detecting matches.

Changed it so that the known array loops once and checks scrapedTexts for a match (if an index exists). If a match is found, I remove the object from scrapedTexts using that index value.

Then I pass scrapedTexts to the next bit, rather than newTexts.

nolanw commented 3 years ago

@dfsm Amazing!! Great catch.

I wanted to figure out what was going wrong. Turns out we're completely unprepared for smilies to disappear. Not only does removing even one smilie completely bork the array diffing, we don't bother deleting the smilies that disappeared.

I figure we should delete disappearing smilies too, so I did that over in https://github.com/Awful/Awful.app/pull/1091. Can you take a look, see if it makes sense?

nolanw commented 3 years ago

Closing in favour of #1091 :)