InsaneJournal Announcements

Comment rot solved

InsaneJournal Announcements

Comment rot solved

Previous Entry Add to Memories Tell a Friend Next Entry
I found the cause of comment rot. There was an old legacy setting that I didn't know what it did. It was among the last of the things to trace out in the code. I traced it out and found the offending code that was deleting comments and entry properties (status, userpic, etc) and removed it. Please let me know in THIS post if any NEW comment rot occurs after this post.

This has been a very very long and trying road and I want to thank all of you who have stuck it out here in spite of this major bug.


sub new_entry_cleanup_hack {
my ($u, $jitemid) = @_;

# sanitize input
$jitemid += 0;
return unless $jitemid;
my $ownerid = LJ::want_userid($u);
return unless $ownerid;

# delete logprops
$u->do("DELETE FROM logprop2 WHERE journalid=$ownerid AND jitemid=$jitemid");

# delete comments
my $ids = LJ::Talk::get_talk_data($u, 'L', $jitemid);
return unless ref $ids eq 'HASH' && %$ids;
my $list = join ',', map { $_+0 } keys %$ids;
$u->do("DELETE FROM talk2 WHERE journalid=$ownerid AND jtalkid IN ($list)");
$u->do("DELETE FROM talktext2 WHERE journalid=$ownerid AND jtalkid IN ($list)");
$u->do("DELETE FROM talkprop2 WHERE journalid=$ownerid AND jtalkid IN ($list)");
}
</pre>



Edit: After looking at the code even more closely I am sure that this was the cause, I think we can call comment rot a closed issue. Now to getting to writing a mass icon uploader.
  • Okay, what you saw there was the comments were already gone, but they don't "dissappear" right away, they are cached in memory until the cache expires. There may be a few instances of this. But the code that caused the to get removed from the backed is, in fact, gone.
    • Ooh, okay. So when that happens, will we have to click on the entry for the comments to show up as disappeared, or will they eventually show up that way on their own?
      • Eventually they will "rot" out of the memory cache and be gone forever. This shouldn't go on for more than a week.
    • Would the cache issue be why I had an entry that seemed to have all its comments last night -- that is, the number of comments was listed below the entry -- but when I tried to look at those comments they disappeared, and now the entry shows no comments at all?

      I thought they were there two days ago, and they're certainly not there now. But I'd also had the same Firefox session up since before the date of your post; I only restarted the program last night. With any luck this isn't an instance of new comment rot, but I thought I'd better report just in case.
      • It is kind of that. The number shows the old amount of comments before the rot, this isn't updated until you click on the link. So you are only seeing a number updated, these comments may have been lost quite some time ago.
Powered by InsaneJournal