Jump to content


Issue information

  • #035709

  • Duplicate

  • 3.2.3

  • -

  • 0 - None Assigned


Issue Confirmations

  • Yes (0)No (0)
Photo

İmpossible to follow topic is like_visible set to 0

Posted by Nime on 04 February 2012 - 04:01 AM

I have had a weird problem for a long time on my forums and only now managed to track it down.
I did not investigate all the details, but apparently some of the records in core_like table are marked as invisible

disputaz_forum=> select count(*), like_visible from core_like group by like_visible;

count  | like_visible
--------+--------------
  14534 | 0
149385 | 1

Now, I try to follow topic that I am already following, but like_visible is set to 0 for some reason. In this case isLiked() function, which calls getDataByMemberIdAndRelationshipId() function, cannot find this record, since it has hard-coded condition of "like_visible=1". Therefore it proceeds with adding a record to core_like, but since generated primary key happens to be the same, I get a unique constraint violation error.


cat sql_error_latest.cgi
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Date: Sat, 04 Feb 2012 08:52:09 +0000
Error: 0 - ERROR:  duplicate key value violates unique constraint "core_like_pkey"
DETAIL:  Key (like_id)=(b74f62ab1bbd67cce41b382a4b49e601) already exists.
IP Address: 109.127.38.236 - /index.php?&app=core&module=ajax&section=like&do=save&secure_key=648b5c6ab43c2d0b5665e967aa8f2edd&f_app=forums&f_area=topics&f_relid=273602
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
mySQL query error: INSERT INTO core_like ("like_id","like_lookup_id","like_lookup_area","like_app","like_area","like_rel_id","like_member_id","like_added","like_is_anon","like_notify_do","like_notify_meta","like_notify_freq","like_visible","like_notify_sent") VALUES('b74f62ab1bbd67cce41b382a4b49e601','c17726e851eca6ac6a9d1c5cf3f3b326','3e2b3668d5fde75d58550cf39166c2ad','forums','topics',273602,1,1328345528,0,1,'','immediate',1,0) RETURNING like_id
.--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.
| File																	   | Function																	  | Line No.		  |
|----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------|
| ips_kernel/classDb.php													 | [db_driver_pgsql].query													   | 1217			  |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/sources/classes/like/composite.php								   | [db_driver_pgsql].insert													  | 511			   |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/applications/core/modules_public/ajax/like.php					   | [classes_like_composite].add												  | 119			   |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/applications/core/modules_public/ajax/like.php					   | [public_core_ajax_like]._save												 | 58				|
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/sources/base/ipsController.php									   | [public_core_ajax_like].doExecute											 | 418			   |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/sources/base/ipsController.php									   | [ipsAjaxCommand].execute													  | 120			   |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'

I am not sure what like_visible is supposed to mean, but in either case it seems to me that isLiked() either should return existing record or do validation in a way that insert() does not fail afterwards

hrmmmm... by all accounts... IIRC, like_visible is whether the follow is "anonymous" or not... eg can other members see you are "following" it.... you shouldn't be able to follow a topic you are already following... anonymous or not.


no, "anonymous" likes are managed by "like_is_anon"

i see that "like_visible" could be triggered by moderator actions, but did not manage to find exact steps required to get to the problem


View PostConnor T, on 05 February 2012 - 10:57 AM, said:

Nime,Check these bug reports. They might help explain things:http://community.inv...125#entry133125http://community.inv...790#entry135790
Yeah, this seems somewhat related, though last response from Matt may mean it was a separate issue..


changed status to: Awaiting Feedback

Could this be affected by you using pgSQL?


Sorry for delay in responding, I was on trip. It could be potentially, yes, but only if this situation should never have happened in the first place.

I mean, if like_visible is set to 0 this exactly same problem will happen on mysql too, as you can judge by the code. I tried to track down when like_visible changes, but couldn't fully understand its role. I see it "should" be set to zero when topic is unapproved, but couldn't repeat the specific actions to get the same situation.

Basicly, my question boils do to whether this is normal to have active "like" on live topic with like_visible set to zero. If yes, then this is a bug in getDataByMemberIdAndRelationshipId. If not, somewhere data is getting screwed and this may or may not be postgresql bug - I will have to investigate further if you explain role of this field.


changed status to: Confirmed - FAO Matt

changed status to: Awaiting Feedback

"like_visible" refers to the item being visible, such as a topic. It'll only let you follow 'visible' data (not hidden, deleted, etc).

The real question is why are those being shown as visibility 0?


changed status to: Duplicate

Matt fixed this from another bug report last week.


Thanks! Any chance to see the link to the duplicate report?






1 user(s) are reading this issue

0 members, 1 guests, 0 anonymous users