twitter64A few days back one of my twitter aps, NewsSnacker.com stopped working for some reason. I have not touched the code in months.  So what the heck was going on?  More odd is that fact the twittFilter was working fine.  They are based off the same OAuth2.0 code.  After a few hours of hacking and dropping trace statements all over the place, I figured it.

I had a quick look at the Twitter blog to see of there was any warnings of something new with the API.  Nothing jumped out at me but I did notice that something was changing from 32 bits to 64 bits.  I did not pay it much mind.  As I was debugging I finally decided to get the keys from the twitter site and manually start making some calls. The site started working again.  What the heck?  I checked my SQL statements and I was getting data from the database.  Then I looked at the last 4 digits just to see of perhaps my tokens got corrupted or something.  They do not match!  For the first 4 digits DO match!  Then it stuck me.  I quickly logged into the database and yup, just as I thought.  I had my fields set to textvar fields set to 40 charters.  Default.  Arrggg.. All this work and it was just the keys getting larger.

I changed to token fields to 64 each and everything started working again.  Well mostly again because I introduced new errors and founds some weakness in the codes that I never noticed before.  That was one afternoon shot to hell.

So if you suddenly find your twitter app is not working anymore, check you database schema, could be a quick fix and save you a few hours.

Share and Enjoy !

Shares