Tuesday, April 10, 2012

How to get a bug fixed...


I've been meaning to do a post like this for a little while and with the last update, this seems to be a good time.

If something happens inside the app that causes it to crash, you'll probably see a window like this:


The important thing to do is hit that "Report" button.  I think that a lot of users don't even consider that as think it probably goes off to Google and into a list of a million other reports never to be read.  That certainly is the case for the Microsoft windows version of this screen.  However with Android, these reports come to developer and can be seen in the development console:


The 4 that I have outstanding are minor and happen infrequently, I've left them as "New" so I don't forget about them.  Each of the reports contain a stack trace (what functions were called before the application crashed).  For example, the bug that was fixed for Monday here's part of the stack trace:


Even if you don't understand everything (I don't always either), the important pieces are:
  • The app version
  • When it happened
  • How often it happens
  • What happens (a null exception in this case)
  • Where it happens (class name, file and most importantly line number)
The other bit of information that comes along is provided by the user.  When you tap the Report button you're given a chance to include a note of what you were doing (you could also include beer suggestions or your thoughts on Hockey or Soccer teams).  These notes are optional and not nessacary, but the user who sent in this report also sent a good note on what they were doing.
attempted long press set action on second dock of 4th icon to Music App
This defiantly helps me re-create the bug, but wasn't as important in this case.  Looking at the code I realized what had happened on line 512.  I had a check to make sure that I wasn't going to go out of bounds on my list of buttons and if something caused the buttons to go out of bounds, I cleared everything, displayed a toast message and reloaded the list of buttons.  As far as I can tell that's what happened to this user and instead of exiting when the reload was called it continued on (I missed an exit call).  Which then caused the null error.  The fix for this was very simply to add the exit call.

Hopefully this gives a little insight on how things work behind the curtain.