vitorpamplona / amethyst

Nostr client for Android
MIT License
1.17k stars 158 forks source link

[BUG] Replies counter includes notes with filtered words #1089

Open dtonon opened 2 months ago

dtonon commented 2 months ago

Describe the bug As per subject, the replies counter includes notes with filtered words.

To Reproduce Steps to reproduce the behavior:

  1. Add a words in the "hidden words" section;
  2. Check the value of the replies counter against the number of actual replies;

Expected behavior The replies counter should count upfront only the filtered replies.

vitorpamplona commented 2 months ago

Yep, the issue is that processing all feeds beforehand takes about 1 second before the feed loads. If we do it while scrolling, it creates a "bump" every time a new note is loaded. If we do it async, then the note shows with a number that decreases after the calculations are done, like 10 -> 0 replies, which is weird.

The new caching system I am building will resolve this issue with an intermediary layer of what's visible. But It might take some time to get ready.

dtonon commented 2 months ago

I suspected that the filter was done after entering a thread, since I see some replies and then disappears. Cant't the events be filtered as soon as they are fetched? The hidden words filter doesn't target specific fields, so it could be safely applied on the raw json.

However the async solution is not bad, just don't show the count immediately and fade it in when it is ready.