Goonies

squeaky19


The Ramblings of an Incoherent Administrator

Going Crazy, be back soon!


Previous Entry Share Next Entry
Comment rot solved
Goonies
squeaky19
So on my website InsaneJournal, we have been battling a major problem for about 2 years. Comments would just randomly dissapear from journal entries. Finally today I figured it out. This should be a HUGE windfall for the business as this kept a lot of people away. Now that it is fixed we can really start looking at some growth. I am soooo excited.

  • 1
Congratulations! So what was the problem? Details, man, details!

Since it's not my own code, I've been pouring through it for years. Finally found a referenece to some ugly code

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)");
}


It was buried deep in a library which was called in only one very obscure place. It was intended to fix a problem where a journal entry ID was being reused but the old data wasn't cleaned up properly. That problem in the code had been fixed long ago. Oddly enough I found that I had implicitly enabled this piece of code in my config file. So it was an easy fix to change a 1 to a 0 oddly enough. One single character to fix a years old problem.

Is Insane Journal still using old Live Journal code? I read you were switching to Dreamwith code because it fixed all the bugs and was better code.

We have not switched to DW code. We are considering it and may begin testing it, but we are not guaranteeing a switch at this time.

You know IJ has been down for 6+ hours, right?

Any chance of getting your Twitter updated as to why InsaneJournal has been down all day?

Vita subsided least you olph dreaded could match up fed the mbc.

(Anonymous)
Happy New Year[url=http://sdjfh.in/flexpen/],[/url] everyone! :)

Disney Cars Pixar

(Anonymous)
Such a well written post.. Thnkx after sharing this notify!
[IMG]http://www.sedonarapidweightloss.com/weightloss-diet/34/b/happy.gif[/IMG]

  • 1
?

Log in