JS Ext

Sunday, April 13, 2014

The Screenshot Saga: Episode 1 - Customer Support Attacks

I recently had the (dis)pleasure of adding a 3rd party library to my company's Android app.  While this library had a few features, we only needed two features: the ability to take screenshots (of our app) and the ability to turn that functionality in the event of a catastrophic failure.  The idea was to take pictures of certain transactions in the event that one of our customers wanted to dispute a transaction (I said $100, not $1000).  The developers had exactly no say in the picking of the library.  We were not even allowed to implement it ourselves.  We had to use this library.

The company that wrote this library owes me a nice bottle of single malt scotch.  Customer service was a nightmare.  For starters, the killswitch didn't work.  It eventually came out that this was my company's fault, but it took some....extreme....measures to figure this out.  The library fires off an HTTP GET and looks for a response.  The developer who wrote the JSP used the JSP Designer view, not the text editor view.  Therefore, the JSP didn't return the needed 0 or 1.  It returned a <html><body>1</body></html>.  A little bit of logging would have helped on that one.

The next issue was the fact that we couldn't take a screenshot of the entire scrollable area of the page.  It didn't matter what View you passed in.  The library would get the root View of the page and take a screenshot of that.  The company kept giving us some blanket statement about how only our "developers know when the entire view is visible".  I was not happy about their support staff's veiled insult towards me.  I eventually disassembled their Jar file.  I tracked down the one line where they inadvertently took the screenshot of the root view, not the passed in view.  I got so frustrated with their support staff, I actually pulled up their source code on a WebEx!!  They still didn't believe me.  That issue was fixed in a new release of the library.

The next issue was sending the screenshot to the server.  Taking the screenshot doesn't automatically send the screenshot to the server.  You have to either wait for the flush interval or use a manual flush.  My company opted to use the manual flush while most other clients used the interval.  It turns out that so few people actually use the manual flush, that nobody noticed that it runs in the "foreground".  There was a noticeable freeze in the app.  I disassembled their code and turns out that call new FlushTask().execute().get();  For those of you not familiar with Android development, what that means is the flush is run in the background, but we wait for the flush to finish....essentially negating the fact that the flush is running in the background.  My first instinct was to run it in my own AsyncTask, but for some reason, the FlushTask actually used a thread local variable, causing it not to work when invoked from a background thread.  Why would they do this!!!  Luckily FlushTask() was public so I could invoke it directly.  Technical support was no help.  First, they told me to just use my own AsyncTask.  Can you believe we pay them money for this?  Finally they tell us that another company complained about the same thing and that their next fix pack was going to fix the issue.

Our saga continues.  We got the next fix pick and it was a mess.  Tune in next time!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.