Interesting Lobsters exception in my inbox this morning: ArgumentError in `delete': wrong number of arguments.

What? We never get clever with *args, so how did this code ever work? Funny story about the rest of the web, actually...

Lobsters fetches web pages for a couple reasons:
* to prefill the title field on new links as a convenience
* to cache story text for the search engine
* to check for rel=canonical links
* to auth github/twitter/keybase accounts
* to send webmentions back to blogs

Follow

The exception came from deep in the common page-fetching code. In set_cookie:

if val.to_s == ""
@cookies[host][name] ? @cookies[host][name].delete : nil
else
@cookies[host][name] = val
end

Sites delete cookies by "setting" them to empty string, so the logic's right, but there's an obvious confusion in how to delete from a Ruby hash, should be .delete(:name). This indeed never worked.

Next step is 'git blame' to see how we introduced this recently. Right?

Nope. This code is untouched since 2012-06-16. It really never worked.

It just took 7.5 *years* for a website to delete a cookie rather than set one. That's 60k submitted stories before 1 removed a cookie!

Sign in to participate in the conversation
Octodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!