a quirk when implementing atom/rss

Published on • Updated on

last night, i got a message from my friend izzy (@bruxisma) that my atom feed was broken. xe told me xe was using nom, a cute little tui feed reader written in golang, and that xe could see the list of posts in my feed but couldn't open them. so, in my hubris, i cloned it and started looking at how it parses atom feeds: surely my markup is correct, because it works in my reader! ... right?

(balatro wheel of fortune voice) nope!

the atom rfc isn't exactly clear on whether links must be absolute. it does say that a link must "be [an] IRI reference" (an iri is just a uri that can have unicode characters in it) and must "[identify] an alternate version of the resource described by the containing element". i could see those statements allowing for links relative to the site root, but thinking about it practically, it absolutely makes sense that many readers wouldn't bother implementing that feature if they didn't have to: figuring out what a relative link is relative to sounds like a series of educated guesses that would be very frustrating to both implement and to use.

izzy even called this out when xe first messaged me, and it just went in one ear and out the other:

Looking at the feed each link isn't a full URL and I'm not sure if that's part of the spec or not, but having spoken with a few folks that seems to be the case >_>;

so, i changed my feed template to generate absolute links instead of relative ones (thankfully a really easy change), and of course, it worked. thanks izzy!

so. if you're implementing an rss or atom feed, make your links absolute! and also, listen to your smart friends before you waste an hour trying to debug a functioning application!

also, i have to say, golang is absolutely dreadful to read, for the purposes of figuring out what's going on when you run into unexpected behavior. i would selfishly request that nobody ever write anything in golang again, specifically just so i don't have to read golang ever again. 🙃