CFC Component executes twice?

I have a weird problem that started around 5.3.7. I have a simple cfc script I run to charge stored credit cards for occasional second shipments. The script is easy with a for loop going through shipments and charging the ones that need it. I have had this script and component for years with no problems. Around 5.3.7 timeframe I started to get double charges. I put a stopgap fix in and writeOuput statements to debug but nothing shows a duplicate loop. Still the component charges the card and then does it again for some reason. My main site uses the component fine, so I am pretty confident it isn’t the component. I haven’t tried 5.3.8 yet since this is my production site.

Well, it dawned on me, as I was finished writing the above, to check my apache logs. Sure enough, I have 2 entries for the script about 4 seconds apart. I also moved from Firefox to Microsoft Edge about this time. I wonder if Edge is doing something weird. Will try Firefox again next time I have to run script.

1 Like

FYI. It is hard to test since I don’t need to run the script often. So far, Firefox has run it fine while Edge still seems to execute twice.

In Dev tools, with preserve logs, you can see the browser callstack for each request under initiator (or whatever edge renamed the chrome speak!)

I was able to try this morning. The Dev Tools is the same. I was going to do it but my default new tab loaded news and was loading junk in the log so I went to change new tab settings. I noticed a preload option. Turned that off and went to a the basic tab and my script ran fine. Don’t know which option made the difference. I am wondering if it is something with that preload option.

Most of my utility scripts ask for input first except this one. I assume that is why I never noticed anything before.

Just updating to note I am still having problem with Edge and my cfscript fm. Ran fine for years till I move to Edge. The cfm basically reads an order query and a for loop goes through and charges each order and sleep for 2 seconds and continues loop. Luckily I can set my a setting for Authorize.net duplicate timeout to prevent actually duplicate charging but do get an error back from Authorize it tried to charge a duplicate.

Tried:

  • Added writeOutput() everywhere. No duplicates of text but still tries duplicate charges.
  • Firefox. Works fine.
  • Edge with Dev Tools Network tab activated and disable cache checked. Works fine.

To try:

  • Chrome, Since Edge is chromium based.
  • Edge without disable cache in Dev Tools.