Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmoderated-queue count wrong #4134

Open
ihardyslide opened this issue Jan 17, 2023 · 5 comments
Open

Unmoderated-queue count wrong #4134

ihardyslide opened this issue Jan 17, 2023 · 5 comments
Labels

Comments

@ihardyslide
Copy link

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
@tessalt
Copy link
Contributor

tessalt commented Jan 20, 2023

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.

@ihardyslide
Copy link
Author

ihardyslide commented Jan 20, 2023

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

Thanks & BR

@mvdwaeter
Copy link
Contributor

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.

@rigperro
Copy link
Contributor

rigperro commented Aug 1, 2023

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.

@ihardyslide
Copy link
Author

Hi,

@tessalt just wanted to ask if there is any update on this for a fix or if you could guide me with an example update statement for the DB meanwhile.

Thx & BR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants