Tuesday, February 22, 2011

Fixing Our Bug

What seemed like a relatively simple bug to fix turned out to be a little complicated.  The person who posted the bug suggested that any white space before and after the user's name should be trimmed.  We emailed the developers' list to let them know that we were interested in tackling the bug, and to ask them where we could find the code. 

Bringing this issue to their attention caused quite a string of emails about how making this change could negatively affect some users.  There are some users who choose to add white space in their user name to make a picture (emoticon).  We sort of understood the issue, but I wanted to make sure that we could duplicate this type of user name so that we could test our fix on those situations.  We followed a link in one of the developers' emails to a blog that included a picture of the multi line user names so we could see what it looked like.  Then it took a while to actually implement one.  It's not actually possible to type a new line character into that field.  We were finally able to make it work by typing the multi line emoticon into the Write activity and then pasting it into the user name field.

Once we were able to reproduce the situation, we could attempt to fix the problem.  We assumed that when first creating an account, a user would only enter a name with no special characters or new lines.  In this file, we simply trimmed (strip()) the name before saving it.  Once logged into Sugar, the user has the option of changing their name in Settings.  In this file, we check to see if any of the characters were a new line character.  If that were true, we wouldn't strip the white space.  If it were false, we assumed it was just a normal name that only included letters so we stripped the white space.

The Sugar Labs wiki didn't give instructions for submitting a bug fix.  To learn more about this process, Jordan emailed the developers' list again and attached the 2 files that we changed.  I think he received a reply stating that they agreed with our changes.  Not sure yet what will be done with them.

No comments:

Post a Comment