talk icon indicating copy to clipboard operation
talk copied to clipboard

Unmoderated-queue count wrong

Open ihardyslide opened this issue 2 years ago • 5 comments

Hi,

my Coral installation has some kind of bug with counting how many unmoderated comments there are currently, in the Admin Dashboard.

image

In the beginning the calculation was correct, but as longer as we are using Coral, the more in the negative numbers it gets. It is slowly counting down and I have no idea why.

Currently it's at -16 when we have no new comments waiting to be moderated and the number should be actually 0.

I tried to reverse engineer it, but the only thing I found out was, that in the MongoDB it is already stored wrong. This is a snippet of the only stored site in the mongo db sites collection:

image

I did not find any related issues so I opened this ticket now.

Expected behavior:

Count for unmoderated comments is correctly calculated and displayed.

Actual behavior:

Count for unmoderated comments is negative.

Related Issues: /

Versions:

  • Coral: Docker container 7.3.0
  • NodeJS: 16.8.1
  • NPM: 8.19.2
  • MongoDB: Docker container 4.2
  • Redis: Docker container 3.2
  • Browser: Chrome latest
  • OS: Windows

ihardyslide avatar Jan 17 '23 16:01 ihardyslide

Hi there, unfortunately this is a known issue with Coral, counts sometimes get out of sync over time if simultaneous or conflicting requests modify the count data. In the long term we're looking into solutions to address this, in the meantime we do sometimes manually update the database to correct counts on stories we know have incorrect counts.

tessalt avatar Jan 20 '23 17:01 tessalt

Hi, thanks for the info. Could you please instruct me which table I have to update?

Thanks & BR

ihardyslide avatar Jan 20 '23 19:01 ihardyslide

It would be great if there was some sort of management script that resets the counts. Assuming you turn off commenting in the night, it could be run each night to fix these negative numbers.

mvdwaeter avatar Jun 19 '23 11:06 mvdwaeter

https://github.com/coralproject/coral-counts There was this, however I'm not sure it worked. It is somewhat simple, however tedious if continuosly necessary to reset them by hand. It is done via redis and for example HINCRBY "<identifier>:commentCounts:moderationQueue:queues" "unmoderated" <amount> No need to turn off the commenting for this.

rigperro avatar Aug 01 '23 05:08 rigperro