I've been trying to track down a bug where error messages aren't appearing when submitting the sales/guest/form form.

From what I have found so far, on submitting the form, if you enter incorrect information or information for an order registered to a customer account, it's as if the request gets processed twice, where the second time through is the response that gets sent back, causing error messages to be stripped out.

Stepping through the code, it's as if the form data gets processed, an error message gets registered, sales/guest/form gets rendered (including error message), then the process gets redirected back to sales/guest/form and the standard form renders again w/o error messages.

If I submit the data by Ajax however the page only renders once, and the response has the error messages in it.

From what I can see the first time through Magento would run through line 125 of `Mage_Sales_Helper_Guest`, method `loadValidOrder()`

    Mage::app()->getResponse()->setRedirect(Mage::getUrl('sales/guest/form'));

But I've tried stripping out this redirect which just causes `sales/guest/view` to be rendered as a blank page.

Is this redirect correct?  It's the only thing I can see that would be triggering the double render.

Edit: Stepped through code again, it goes through the sales/guest/view action which adds the redirect, then through the sales/guest/form action for the first time, then it goes through sales/guest/form AGAIN