Jump to content

Bug with recount functionality?


Gabriel Torres

Recommended Posts

Hi,

Two days ago I launched the "recount posts" background task for all users in our forums. Today, we noticed that all counters are now completely incorrect.

A few examples:

http://www.clubedohardware.com.br/profile/664373-rodrigodcvieira/

mysql> SELECT member_posts FROM core_members WHERE member_id='664373';
+--------------+
| member_posts |
+--------------+
|        26252 |
+--------------+

mysql> SELECT count(*) FROM forums_posts WHERE author_id='664373';
+----------+
| count(*) |
+----------+
|     6566 |
+----------+

http://www.clubedohardware.com.br/profile/774412-zucchini/

mysql> SELECT member_posts FROM core_members WHERE member_id='774412';
+--------------+
| member_posts |
+--------------+
|         8006 |
+--------------+

mysql> SELECT count(*) FROM forums_posts WHERE author_id='774412';
+----------+
| count(*) |
+----------+
|     5646 |
+----------+

http://www.clubedohardware.com.br/profile/748347-marcos-frm/

mysql> SELECT member_posts FROM core_members WHERE member_id='748347';
+--------------+
| member_posts |
+--------------+
|         1842 |
+--------------+

mysql> SELECT count(*) FROM forums_posts WHERE author_id='748347';
+----------+
| count(*) |
+----------+
|      462 |
+----------+

Is anyone else facing the same issue?

Link to comment
Share on other sites

@newbie LAC @Daniel F What other content is counted? Because for a regular user, I don't understand what other content would be added besides posts. Private messages?

See the case of the first user. He is a regular user and we are talking about a discrepancy of 20,000 items. I can't imagine what other 20,000 items this user has created.

Because before I ran the task, the counters were reflecting the number of posts for these users.

Link to comment
Share on other sites

5 hours ago, Gabriel Torres said:

What other content is counted?

%Application items%, %Application item comments%, %Application item reviews%

Example Calendar events, calendar event comments, calendar event reviews, gallery images, gallery image comments, etc.

5 hours ago, Gabriel Torres said:

Private messages?

No.

8 hours ago, Gabriel Torres said:

See the case of the first user. He is a regular user and we are talking about a discrepancy of 20,000 items. I can't imagine what other 20,000 items this user has created.

Looks like incorrect value

memberposts.thumb.jpg.49681f9b0228d10d173f08230cfaafa7.jpg

I recounted content for that user

memberposts2.thumb.jpg.952fb92087b4d44fb75f83776266f344.jpg

Link to comment
Share on other sites

@Nathan Explosion I am not allowed to open tickets, hence the only support I can get is through other members like yourself. That is why I am asking if this is happening on other boards as well. Could you run the recount background task to see if this issue also happens on your board? I need to make sure this isn't caused by a modification we might have.

Link to comment
Share on other sites

  • 2 weeks later...

After debugging made on weekend I can confirm a bug.

POC

- Enable

cms_forums.thumb.jpg.d2f5c324bea0600380b8e1718ef12a1f.jpg

- Create new article

- Add comments

Now starts interesting thing.

When someone viewing the database pages (articles, database, categories) (background task running in this time) the Record comments class is IPS\cms\Records\CommentTopicSync%DB_ID%

\applications\cms\sources\Records\CommentTopicSync.php

	public static $databaseTable = 'forums_posts';

So the system counts ALL member forums posts for every cms database (if enabled posting). The query looks like

SELECT COUNT(*) FROM forums_posts WHERE author_id=X;

Gabriel Torres provided me some examples after the task has been finished

Results

recount_bug.thumb.jpg.1b9ed307f92de314a45ad13839e5ee8a.jpg

recount_bug2.thumb.jpg.1bc170101ae9ed473db0c7f49342580f.jpg

etc.


Tested also locally.

IPS 4.2.6 and IPS 4.2.7 Beta 4. Fresh installation.

Simple code to recount content for specific user

recount.thumb.gif.a50b94f9ca841a918a9a5e8e15487225.gif


Ticket #996114

Link to comment
Share on other sites

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...