Small Errors Add Up

Reddit is one of the most popular social sites on the Internet. Everyone uses it from a normal person such as yours truly, to reporters and news agencies. While the site itself appears fairly straightforward, it is actually one of the more impressive sites we have encountered. A strong tech team has created a powerful platform.

That does not mean they are immune from errors or weird designs. This weekend we saw something fascinating. The ‘edited’ object (which we assumed it said whether a post was edited or not) in the ‘listing/hot‘ endpoint started firing errors. We were occasionally seeing 10 digit integers, instead of  the boolean responses that we expected. How does something go from true/false to 1442162355?
We later realized that field is either false or the epoch of the last time the item was updated.

So it wasn’t actually an error, but this decision is weak. A data item that is free to switch from one type to another can cause a big amount of drama to developers, especially if the documentation doesn’t clearly state what to expect.

No one is perfect and often companies do not even realize it. API payload monitoring and validation is not an extra service – it should be the default service for everyone with a public API.