title: magento error message only displays after 2nd page refresh
body: <p>I have an observer watching the event sales_quote_item_set_product. In it, i am checking some conditions to make sure the item is still available. If it is not, i run this code:</p>
  
  <pre><code>Mage::helper('checkout/cart')-&gt;getCart()-&gt;removeItem($item-&gt;getId())-&gt;save();
  Mage::getSingleton('message/session')-&gt;addError($item-&gt;getName() . ' is no longer available.');
  </code></pre>
  
  <p>The problem I'm having is if an item becomes unavailable and a guest is on a product view page, the cart says the item is in the cart, but the total for the cart is updated to reflect the product being removed. Also the error message is not displayed. If you go to another page or refresh the product view page the error message will display and the number of items in the cart will be correct.</p>
  
  <p>So my thought is i need to run this code earlier in the execution cycle, but i have no idea what event i should be observing, or if i shouldn't be using an observer at all. I tried using sales_quote_load_after, but that caused a recursion error somehow. Can anyone tell me when/where i should run this code?</p>
  
  <p>Another wild thought is could it be because i'm using database sessions instead of the file system?</p>