1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed xf_feed_log updates on duplicate key?

Discussion in 'Resolved Bug Reports' started by Jake Bunce, Sep 10, 2011.

  1. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    What is the purpose of this code?


    		if ($writer->get('thread_id'))
    				INSERT INTO xf_feed_log
    					(feed_id, unique_id, hash, thread_id)
    					(?, ?, ?, ?)
    					hash = VALUES(hash),
    					thread_id = VALUES(thread_id)
    			', array($feed['feed_id'], utf8_substr($entryData['id'], 0, 250), $entryData['hash'], $writer->get('thread_id')));
    Why would you update on duplicate when the purpose of xf_feed_log is to prevent duplicate rss posts? At this point in the execution the dupe checker has already run so there shouldn't be any duplicate insertions. I think the entire transaction should be rolled back at this point.


    I ask because of this guy's problem:


    It turns out the feed did not have a unique guid for all items. Granted, this is a problem with the feed itself. But the guid problem was causing the dupe checker to miss some items which were then allowed to be inserted by the above code. I found myself wondering why you would ever want to allow a duplicate insertion here.
    robdog and Raitsa like this.
  2. robdog

    robdog Well-Known Member

    Hoping we get some love from Kier on this. Just ran into this problem on one of my sites and am worried about my other sites having the same issue.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I am still trying to identify and reproduce your problem. We don't yet know if it's related to this bug report.
  4. Veer

    Veer Well-Known Member

    I'm not sure about the bug but some time im also facing same problem, I'm running multiple feeds and some time one feed starts causing problem and importing same article again and again any time when it runs. So i disabled that and then after few days another feed starts causing same problem.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It's probably best that you start your own thread for your specific problem. Post in the Troubleshooting forum and include the URL of the feed. I will take a look.
  6. Kier

    Kier XenForo Developer Staff Member

    Mike and I have both looked at this and tried to work out why the dupe update is there, and we kinda drew a blank. I'll change it in the next release to make it a bit more sensible.
    Veer and The Dark Wizard like this.
  7. Kier

    Kier XenForo Developer Staff Member

    Should be resolved now.
    Veer likes this.

Share This Page