After I spam a comment via the app, I expect that if I get a notification, it would read "Comment successfully spammed"
After spamming a comment via the app, I get a notification that the comment was successfully approved. It hasn't been (fortunately).
Open app, navigate to Notifications.
Open a comment notification
Tap on Spam
Close the app or otherwise carry on with your day, and await the notification.
App version: alpha-144
Moto x4 running Android 9 Pie
Moving to the Prioritized list so we can check up on this one and give it attention if spammed comments still misbehaving. Thank you for reporting this issue @zandyring !
Noting that the last time I spammed a comment on my phone, this DIDN'T happen - I assumed it was fixed!
App version now is Alpha-166
Android v9
Moto x4
Cool. In that case, we'll just want to test, verify, and close the issue. 鈽猴笍
I've spent hrs trying to debug this issue with poor results.
The notifications and push notifications code is async and decoupled resulting in high difficulties when trying to debug to reproduce the problem.
I was able to get the notification only once - with an old version of the app - and it was saying something like "Comment approved".
Tested several times, but not able to get any notification at the moment, nor the one that says "Comment successfully spammed", nor the problematic one. When i mark a comment as spam, and close the app, nothing happens. Same if I left the app open in foreground on the notifications screen.
Where the message "Comment approved" is created/used in the global system notifications on the app side? cc @mzorz The part of the app that uses this wording is the comment screen, where a Toast is shown with the "Approved|spammed" message when the action is taken.
Tested several times, but not able to get any notification at the moment, nor the one that says "Comment successfully spammed", nor the problematic one.
I also haven't gotten a "correct" notification when I spam comments. There's no notification at all.
hi 馃憢 been looking into this! Interesting indeed, and as rightfully described it's not easy to reproduce :).
The only place where Comment approved! message notification is shown in code is (supposedly) when a notification's quick action has been triggered and has completed.
I can think of the following situation as a possible case:
If the NotificationsProcessingService (used mainly for notifications quick actions processing) is running, which also means the class has been registered with FluxC's dispatcher and as such onCommentChanged() subscription callback gets called not only for actions triggered from the service but also for any kind of actions on the FluxC database. If the network is slow enough, this could mean something you do to moderate (approve/spam) a comment on the app's Notifications tab, after already having approved a comment as a quick action, will also get collected by the registered callback.
Furthermore, the callback assumes there are only effectively like/reply/approve actions (as that's the design for quick actions), and maps a successful FluxC level action CommentAction.PUSH_COMMENT to be equal to approving, when it might actually not be the case.
Hence, tapping on a quick action and then opening the app while the action is taking place, and spaming something there can lead to this situation. Difficult to reproduce, but still plausible. There are still other reasons why the Service could still exist in memory even if not really running, and given it hasn't been destroyed it will still be "listening" to FluxC events, producing these notifications as well.
Been looking into FluxC's code to see if we can match the API responses to which notifications quick action triggered them, and it seems we do have event.changedCommentsLocalIds in the response's payload, so in theory it should suffice to be able to compare triggered actions and responses by their Comment's local ids to make sense of what to notify the user about and what not (that is, for the time being, we should only produce notifications for quick action buttons-triggered actions within the NotificationsProcessingService, and none in particular for handling those that are triggered from the app's main screens).
Even if not easy to reproduce, I think we can surely add this check as it's reasonable to add anyway - I'll try and put a PR with this shortly 馃憤
Hence, tapping on a quick action and then opening the app while the action is taking place, and spaming something there can lead to this situation.
Just to report that I was able to reproduce the problem yesterday, unfortunately only once, and on an old version of the app, without using Quick Actions. I was manually testing the app, and i'm sure I didn't use Quick Action buttons since was in the app and tapped on the spam button in notification details screen, and send back the app to BG.
The message "Comment approved" was there in the notification center, and it was very alarming from a user point of view. I don't remember if I swiped over this new notification, or it disappeared automatically (because of a badge reset).
Thanks for the comment @daniloercoli ! That reinforces that it's definitely coming from FluxC registered callback in NotificationsProcessingService though (because it's the place where that notification can only come from) so, will put a PR along those lines. Will also try to reproduce as well 馃憤
Yes, @mzorz it is the service.... I was able to reproduce it once again while testing other things 馃殥
Steps to repro:
Awesome! Thanks for the steps to repro! :D
Most helpful comment
Yes, @mzorz it is the service.... I was able to reproduce it once again while testing other things 馃殥
Steps to repro: