DEV Community

loading...

Discussion on: What's the longest time you ever spent debugging your code and how did you fix it?

Collapse
haideralipunjabi profile image
Haider Ali Punjabi

2 1/2 to 3 months. I started developing an Android app which used Facebook API back in December 2016 (before all that Data Leak, etc so the API was much different). As it was my first time with FB API, I started testing different endpoints to get used to the API.
One of the first things I tested was the uploading endpoint to upload a post with a photo. I tried adding an upload progress bar in the notifications and was faced with the worst bug of my life. The progress used to hang at a particular value for large files and then skip directly to 100%.
I asked for a solution on many sites including SO, but didn't find any answer.
I finished the first version of the app and released it for testing at the end of February 2017 but the bug was still there. I spent the next month fixing it and finally asking the question on Facebook Developer Support helped me.

Apparently, the official docs at that time had the code sample on sending the photo as a byte array, and the fix was to send it as a bitmap.