Skip to content

RSS feed produces duplicate items every time the year rolls over #2

@ap

Description

@ap

Consider this line in Labyrinth::RSS. That’s just so wrong.

The entry ID is supposed to be a globally unique identifier which is completely stable and immutable – because even the URL sometimes isn’t. But Labyrinth generates an entry ID that depends on what the current year is… so at 23:59pm on NYE it gives all entries in the feed one identity, and one second later at midnight Jan 1, it suddenly gives them another.

Now let me quote RFC 4151 (“The ‘tag’ URI Scheme”) section 2.2:

The date specifies, according to the Gregorian calendar and UTC, any particular day on which the authority name was assigned to the tagging entity at 00:00 UTC (the start of the day). The date MAY be a past or present date on which the authority name was assigned at that moment.

What this means is that you can effectively use a constant for the date (note that using a naked year is just shorthand notation for midnight Jan 1 that year), as long as it’s a point in time at which you controlled the domain. That may require adding a configuration value to Labyrinth deployments, so you may not want to do it that way. In that case, you could also derive the timepoint from the entry creation time, assuming that that is immutable. Or in fact, you can use pretty much any approach of picking a point in time you want… as long as it will always yield the same result for a particular entry.

But you can’t use the current year. Because that will produce changing results for the same entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions