Skip to content

[$75] Discussion/comment counts are incorrect in roundtables - production #424

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

Closed
sdgun opened this issue Feb 22, 2021 · 25 comments
Closed

Comments

@sdgun
Copy link
Collaborator

sdgun commented Feb 22, 2021

Steps
Log into production forums
GO to Roundtables
Check the General category

image

Go inside the category and check the discussions/comments

No discussions/comments inside

Screencast.2021-02-22.mp4
@sdgun sdgun added bug Something isn't working P1 Prod Env labels Feb 22, 2021
@jmgasper
Copy link
Collaborator

@sdgun - Yeah, I think this fix was part of what I had to back out to fix the permissions issue.

@jmgasper jmgasper changed the title Discussion/comment counts are incorrect in roundtables - production [$75] Discussion/comment counts are incorrect in roundtables - production Feb 22, 2021
@jmgasper
Copy link
Collaborator

Challenge https://www.topcoder.com/challenges/eef1051a-26a8-48dd-bd9a-c8f1a6d9b1c9 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator

@atelomycterus - I know we have a fix for this, but can we separate out the fix for this from the performance updates please? I'd like to get this pushed separately so we can get it out quicker than the performance stuff.

@jmgasper
Copy link
Collaborator

Challenge https://www.topcoder.com/challenges/eef1051a-26a8-48dd-bd9a-c8f1a6d9b1c9 has been assigned to obog.

This is an automated message for ghostar via Topcoder X

@atelomycterus
Copy link
Collaborator

@jmgasper I've checked PROD. In general, both counts are correct. I think "wrong counts" because General had 'Discussion type' before.
Solution: change categoryID for Discussion. Use 'Move'. Please test it in DEV. Create a category (Discussion type), add discussions, change the type to 'Nested', add more data, move a discussion with comments, check counts.

PROD

Check 1

From Db
'select count() from GDN_Discussion where CategoryID=1' => 4 ("DiscussionID": 1136, 1166, 1272, 2492)
'select count(
) from GDN_Comment where DiscussionID in (1136, 1166, 1272, 2492)' => 5 comments

image

Check 2

image

Issues 386 + 502/504

@atelomycterus - I know we have a fix for this, but can we separate out the fix for this from the performance updates please? I'd like to get this pushed separately so we can get it out quicker than the performance

#386 is a different issue. Wrong Comment count in #386 was due to 502/504 errors. If a new comment was created, and the setCache recalculation wasn't completed, then as a result the data in the cache and in the database are different.

@atelomycterus
Copy link
Collaborator

@jmgasper ☝️ https://discussions.topcoder.com/discussion/1136 -> You can see these discussions:
image

@jmgasper
Copy link
Collaborator

@sdgun ☝️ Can you test please?

@sdgun
Copy link
Collaborator Author

sdgun commented Feb 23, 2021

@atelomycterus Not sure what I did is what you are asking in your comment above.

  • In https://vanilla.topcoder-dev.com/groups/mine?filter=challenge, I created a category named 'Ext category' in the development challenge Scheduler API Test 1
  • Then went inside it and created new discussion 'Inside Ext discussion'
  • And created 2 comments in 'Inside Ext discussion'
  • Moved 'Inside Ext discussion' into another development challenge forum('Sched Api 23 | Mithun')
  • Th counts were correct after this move in both discussions

@atelomycterus
Copy link
Collaborator

@sdgun Sorry about that, I updated steps. Let me know if you have any questions:

  1. I created 'General(Issue-424), https://vanilla.topcoder-dev.com/categories/general%28issue-424%29. Please use it for testing.
    The category displays as 'Discussions'.
    image

  2. Then create two discussions in 'General(Issue-424)':

    • 'Discussion 1' + 1 comment.
    • 'Discussion 2' + 2 comments.
      Remember discussion IDs/links.
  3. Change DisplayAs from 'Discussions' to 'Nested' for the category. After that user can't create new discussions:
    image

  4. Click on 'Add subcategory'. Set Name, DisplayAs 'Discussions'. Add several discussions with comments:

image

  1. Move 'Discussion 1' (from p.2) into another forum. Use TonyJ account or any admin roles. Check count of discussions and comments.
  2. Delete 'Discussion 2'(from p.2). Check count of discussions and comments.
  3. Delete the category after testing

@sdgun
Copy link
Collaborator Author

sdgun commented Feb 24, 2021

@atelomycterus Not related to this issue, but I see a challenge discussion in the roundtables(log in as Copilot).

image

@sdgun
Copy link
Collaborator Author

sdgun commented Feb 24, 2021

@atelomycterus Executed only steps 1to 4 and noticing the counts incorrect. The counts displayed in the category 'General(Issue-424)' are incorrect.

Screencast.2021-02-24.mp4

@atelomycterus
Copy link
Collaborator

@sdgun That's right, they must be incorrect at this step. The same issue in PROD.

Within General(Issue-424) - 3 discussions , 9 comments:

2 discussions were added at p.2 , you don't see them due to 'DisplayAs=Nested' but you can only see by direct link:
https://vanilla.topcoder-dev.com/discussion/3631 -1 comment
https://vanilla.topcoder-dev.com/discussion/3632 - 2 comments

Total: 5 discussions, 12 comments.

After steps 5 (Moving https://vanilla.topcoder-dev.com/discussion/3631), Both counts should be decreased (4 discussions, 11 comments)
After steps 6 (Moving https://vanilla.topcoder-dev.com/discussion/3632), Both counts should be decreased.

@sdgun
Copy link
Collaborator Author

sdgun commented Feb 24, 2021

@atelomycterus Thanks, the counts are correct after moving/deleting.

@atelomycterus
Copy link
Collaborator

@sdgun Thanks!

PROD

@jmgasper Need to move/delete discussions ("DiscussionID": 1136, 1166, 1272, 2492) in PROD. After moving/deleting the counts should be correct.
These discussions in 'General':
image

@atelomycterus
Copy link
Collaborator

@sdgun

@atelomycterus Not related to this issue, but I see a challenge discussion in the roundtables(log in as Copilot).

image

This category was created for a challenge. This category should not be at this level. The challenge - https://www.topcoder-dev.com/challenges/c1fcdad4-07a5-46f3-9cef-9609c04e76be

image

Challenge processor forum created it because the description is 'Welcome to Topcoder Development challenge! Please post your questions in this forum, thanks!'. This phrase is used in template.json. It looks like someone was testing with a different template.json. 2 categories with the same name were created but urls are different, no discussions.

What names to use for the category, how to generate url and what discussions to create by default is managed via template.json

@jmgasper Maybe you know? ☝️

@jmgasper
Copy link
Collaborator

@sdgun - that particular group was created manually for testing. It was not created by the challenge forum processor

@sdgun
Copy link
Collaborator Author

sdgun commented Feb 24, 2021

@jmgasper @atelomycterus Thanks

@jmgasper
Copy link
Collaborator

jmgasper commented Mar 1, 2021

Payment task has been updated: https://www.topcoder.com/challenges/eef1051a-26a8-48dd-bd9a-c8f1a6d9b1c9
Payments Complete
Winner: obog
Copilot: ghostar
Challenge eef1051a-26a8-48dd-bd9a-c8f1a6d9b1c9 has been paid and closed.

This is an automated message for ghostar via Topcoder X

@sdgun sdgun added this to the V1.X milestone Mar 2, 2021
@sdgun
Copy link
Collaborator Author

sdgun commented Mar 16, 2021

@jmgasper Looks like we have not move/deleted the discussions in production, the counts still don't tally in General roundtable.

@jmgasper
Copy link
Collaborator

@atelomycterus ☝️

@jmgasper jmgasper reopened this Mar 16, 2021
@atelomycterus
Copy link
Collaborator

@jmgasper Looks like we have not move/deleted the discussions in production, the counts still don't tally in General roundtable.

@jmgasper @sdgun Yes, correct. The discussions have not be moved/deleted in PROD.

@atelomycterus
Copy link
Collaborator

@jmgasper @sdgun I've fixed it in PROD.

https://discussions.topcoder.com/discussion/1136 - a test discussion , deleted
https://discussions.topcoder.com/discussion/1166 => Moved to Home › Roundtables › General › New Here & Getting Started
https://discussions.topcoder.com/discussion/1272 => Moved to Home › Roundtables › General › New Here & Getting Started
https://discussions.topcoder.com/discussion/2492 => Moved to Home › Roundtables › General › New Here & Getting Started

No discussions/comments with CategoryID=1:
image

image

@jmgasper
Copy link
Collaborator

@sdgun - Can you verify please?

@sdgun
Copy link
Collaborator Author

sdgun commented Mar 17, 2021

Verified in production, the discussion/comment counts tally.

@jmgasper
Copy link
Collaborator

@atelomycterus - I'll log a separate ticket for the cleanup work, thanks.

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

No branches or pull requests

3 participants