as suggested by longwave here, http://drupal.org/node/644538?page=1 , I'm creating a new issue. I don't know if my issue relate anyway, despite triggering the same symptoms.
Anyway, using the latest UB dev for DP7 (16-June), latest Rules + Entity API, I am getting the double admin emails and stock adjustment described at the very beginning of that topic.
What I have noticed, perhaps important, or not, is that there is something interesting in one of our latest order: one email specifies an order date of 06/17/2011 - 04:38 and the other specifies 06/16/2011 - 20:38. According to the email headers the emails were fired up 3 seconds apart server side.
This particular customer is located in Japan, and the time discrepancy seem to me to be the time zone difference. Could it be what the problem is? I suspect so since my tests earlier this afternoon, with NO changes made to any part of DP, yielded only 1 notification and one stock subtraction... I am of course in the same time zone as myself :-)
The only thing in my install that differs from the out-of-the-box rules is that the admin email rules uses the 'customer' invice template (more practical for me, in handling the orders), but that would not explain the double decount of stock anyhow, even if that was to part of the problem (though I really don't think so - but it's more inconvenient for me to prove it isn't by reverting the rule then live with the duplicates).
Comments
Comment #1
longwavePresuming you are using PayPal WPS, this will be the same issue, as the code currently acts in the same way.
It is caused by a race condition, where the checkout complete trigger is pulled both when the user returns from PayPal, and when the PayPal IPN arrives, and depending on the order that these happen, the duplicates can be triggered. In your case, this is probably happening one way when you make a payment, and in the other way when a far away user makes a payment.
Once the 6.x patch has been tested and committed, the final patch will be posted here to be ported to 7.x.
Comment #2
RogueM commentedyes, you are correct I use Paypal WPS (as sole form of payment accepted). I'll be happy to test a patch when available, no rush, it's not that much of a deal breaker for me (especially after struggling to get the notifications in the first place, which seems was due to a domain weirdness, or perhaps resolved some other unexplained way). I'm sure there's a way to adjust back up the stock level with an extra rule too, if I really find that debilitating in the meantime.
... great work, btw, I was initially doubtful about UB, looking at the parent website and the sort of answers you get there (or lack thereof), and obviously out-of-date documentation, but I'm very impressed with your and TR's responsiveness and patience. As an ex-opencart user this feels almost surreal.
Comment #3
longwaveClosing as duplicate of #1192018: Duplicate order notification e-mail, and duplicate stock decrement, the D7 fix will be posted there after the D6 fix is complete.
Comment #4
RogueM commented... I don't really want to post in the D6 topic since I'm not sure how relevant the info I may be able to provide are. Today I noticed the following in dlog, perhaps of interest (or perhaps not):
Warning: implode() [function.implode]: Invalid arguments passed in UbercartMailSystem->format() (line 23 of /home/xxxxxx/public_html/drupal/sites/all/modules/ubercart/uc_store/classes/mail.inc).
url location: /uc_paypal/ipn/61
I'm up to date with UB dev, though I have custom rules (that solve the double depletion of stock successfully), so perhaps that's a result of that. It's the first order with those sets of rules in place so I'll report if it is a one off, or if on the other hand it happens every time, so you may assess how relevant-irrelevant this report is to your code.
EDIT: looking at the error more closely, and taking a wild guess, I think this may be related to the fix provided in UB for the email format a week ago or so?