10

The last two days we've been going over this problem for several hours to figure out what's going on and we can't find any clues. Here's what's happening; We have a Flash application that allows people to place orders. Users configure a product and an image of that product is generated by Flash on the fly and presented to the user. When satisfied, they can send an order to the server. A byte array of the image and some other variables are sent to the server which processes the order and generates a PDF with a summary of the order and the image of the product. The order script then sends everything back to the browser.

This is all going really well, except for Safari on OSX 10.4. Occasionally the order comes through but most of the time Safari hangs. When looking at the Activity window in Safari it states that it's waiting for the order script and that it's "0 bytes of ?". We thought there was something wrong with the server so we've tried several other servers but the problem persists. Initially we used a simple post to process the order but, in an effort to solve this problem we resorted to some more sophisticated methods as Flash remoting via AMFPHP. This didn't solve the problem either.

We use Charles to monitor the http trafic to figure out whether the requests are leaving the browser at all but the strange thing is that when Charles is running, we can't reproduce the problem.

I hope someone has any clue what's happening because we can't figure it out.

onomio
  • 361
  • 1
  • 11
  • I doubt this is a problem with your code or server or anything like that. Considering that it works everywhere else, I would put it down as a Flash or Safari/Mac bug. - Let me put it like this: 99% of browser related crashes on Mac's are due to Flash; the flash player *is* one of the most bug-ridden, resource-hogging app in common use; Apple has publicly shunned Flash wherever possible. - Personally, I very much agree with Apple in this, but that's just me. - Sorry I can't be of any real help though :/ – Atli Feb 06 '10 at 17:32
  • Just looking at your title I was going to suggest AMFPHP or ZendAMF, and Charles - but it sounds like you know exactly what you're doing. It's really bizarre that it works everywhere but Safari, since ostensibly the browser isn't even really getting involved - you're making the AMF connection directly from the player to the server. Please let us know if you figure this out! – Myk Feb 06 '10 at 21:50
  • Two things to troubleshoot: 1) Any difference with Safari on other (more recent) versions of OSX? 2) Does Safari (same version) for Windows replicate the bug? – artlung Feb 07 '10 at 00:19
  • @artlung 1) It doesn't happen in Safari on newer version of OSX. Which made us think this may have something today with memory resources running out. But, we ruled that out when monitoring the memory usage. 2) Safari on Windows 7 doesn't replicate it. – onomio Feb 07 '10 at 17:49

1 Answers1

1

just a wild guess:

Is getting the PDF back the result of 1 http request that both sends all needed data to the server and gets the pdf as a result? Otherwise this could be a timing issue - are you sure all data is available at the server the moment the pdf is being requested? The number of allowd parallel connections to a website is not the same for all browser brands/versions, and maybe that could influence the likelyhood of a 'clash' happening.

Easy test: introduce a delay between sending the data to the server and retrieving the pdf and see if that has any effect.

Simon Groenewolt
  • 10,607
  • 1
  • 36
  • 64
  • Thanks Simon, I think it's worth it to give that a try. It's not really one request, but two. The first sends all the image data and gets a response with a token to make the second request. The second request contains some more order variables. The PDF is the response to the second request. So far, it has always been that if the first request comes through, the second does too and the PDF is also generated, sent and received. – onomio Feb 07 '10 at 10:18
  • I've got some updates on this problem. We've been fiddling around with the timing a bit. It seems to be a big step towards the solution. Currently we're getting errors in Acrobat saying "Insufficient data for an image", but we haven't been able to reproduce the bug on any machine anymore. – onomio Feb 10 '10 at 16:35