destroytoday.com

Contentful mishaps

Continuing my focus on the blog index, I stumbled upon a few Contentful-related issues—all my fault, though. First, while I was writing the last post, I noticed that a handful of my oldest posts were missing. Apparently, when I migrated the 60+ posts from the Cushion journal, I exceeded the default 100-post limit on the request for fetching entries. Fixing this was as easy as setting limit=1000.

Next, I realized that the JSON response from Contentful for all the entries was nearly 300kb! I immediately knew what this meant—by default, the entries included all fields on the blog post model, which included the rich text body field, which includes the entire article along with all its image and link references. No bueno. After a quick google search, I discovered the select parameter, which lets me specify the exact fields I want to return, in case I’m a goofus and pull everything under the sun. I looked at the blog index and pinpointed everything I needed, then pushed. A few minutes later, a handful of emails came through from folks pointing out that all my links were broken. No bueno! Again, I immediately new the issue, which is mainly that I forgot to double-check my deploy, but also that I forgot to select the slug from the posts, so any link would go to /blog/undefined. A minute later, I pushed the fix, and that was that.

This experience has two feels—1) when you work at a company where bugs like this can’t happen, it’s fun to work on my personal website where it’s no sweat when it does, and 2) it’s reassuring to know that folks actually read this! Since I don’t have any analytics, and I haven’t been on Twitter for two months, I have no idea if anyone’s smashing that “subscribe” button or hitting that “like” button. Not seeing any metrics is actually refreshing and feels so much healthier than having that addiction. It lets me focus on my love of writing and makes me not care as much about fine-tuning or being perfect. So, thanks for reading!