Opened 12 years ago

Closed 3 years ago

#543 closed enhancement (no-action)

atom feed IDs: reevalaute taguri

Reported by: Elrond Owned by:
Priority: major Milestone:
Component: programming Keywords:
Cc: Parent Tickets:


Our atom feeds use taguris (RFC 4151).

First thing to re-evaluate: Do we want to/have to use taguris in this place?
There might be good reasons to want this.

taguris have the form {ownerid_namespace}:{localpart}. This is so they are human generatable AND universal unique. the {ownerid_namespace} is formed of {DNSname_or_email},{date}. The date is the time when the domain/email was owned by the author. This is so that a domain can go to a new owner, which in turn has a new namespace.

For feeds owned by a user, we can use the registration date of the user. We currently use the *current* year. Which is plain wrong. Because the id should never change after first being shipped. So this should be fixed soon.

For site feeds we currently use 2011 as the date. We probably should switch this over to something like the "deploy date". The problem is how to find out about it. We could use the date of the oldest entry in the db, but that will change when the oldest image gets deleted by the owner. ("You may not delete the master goblin image.", hoho). No easy solution currently available.

Change History (7)

comment:1 by Will Kahn-Greene, 12 years ago

I vote:

  1. make the year a configuration option
  2. if the admin doesn't provide a year, then find the oldest item in the db and use the year from a datestamp of that (or some similar guess as to when the instance was first created)

comment:2 by spaetz, 12 years ago

I never understood why we are not simply using the feeds URL for the id tag as is done so often, so thanks for the link to RFC 4151 for the justification. I have to say that even after reading of the RFC I remain unconvinced of the advantage of RFC 4151. The main selling argument over an URL seems to be that you can change the id when the domain owner changes hand.

Well, the domain changing hand and the feed URL remaining at the exact same location as before is certainly more of a fringe case in my book than the added complexity thinking about years, uuids and whatnot. Even if it changes hands, we'd need to either manually fudge the tag years or include logic to always calculate the correct year based on deployment (and making sure this value does not change on reinstalls or version upgrades!)

I am +1 for KISS and simply using the feeds URL as id. It is globally unique and remains across version upgrades. The feed tag not changing when the domain owner changes, that should be the least of our worries for now.

comment:3 by joar, 11 years ago

Lazily attaching this information:

22:52:17 < joar> if we were to use a GUID, we'd have to store that with the collection
22:59:22 < Elrond> 22:55 <joar>, section 4.2.6
22:59:46 < Elrond> Can you add that to the bug? That's the one telling us, that we need something uuid-like.
23:00:08 < Elrond> ... and taguris are better than storing yet another crappy DCE-UUID.

Also, diff for proposed solution:

  • mediagoblin/user_pages/

    diff --git a/mediagoblin/user_pages/ b/mediagoblin/user_pages/
    index dea47fb..8602c58 100644
    a b def collection_atom_feed(request):  
    539539                'href': push_url})
    541541    feed = AtomFeed(
    542                "MediaGoblin: Feed for %s's collection %s" % (request.matchdict['user'], collection.title),
    543                feed_url=request.url,
    544                id='tag:{host},{year}:collection.user-{user}.title-{title}'.format(
    545          ,
    546          '%Y'),
    547                    user=request.matchdict['user'],
    548                    title=collection.title),
    549                links=atomlinks)
     542                "MediaGoblin: Feed for %s's collection %s" %
     543                (request.matchdict['user'], collection.title),
     544                feed_url=request.url,
     545                id=u'tag:{user}@{host},{year}:collection.slug-{slug}'\
     546                    .format(
     547          ,
     548                    year=collection.created.strftime('%Y'),
     549                    user=request.matchdict['user'],
     550                    slug=collection.slug),
     551                links=atomlinks)
    551553    for item in cursor:
    552554        entry = item.get_media_entry


comment:4 by Elrond, 11 years ago

Owner: set to Elrond
Status: newin_progress

Okay. I'll revisit this fully the next week. I need to reread a bunch of things and understand them.

comment:5 by Elrond, 10 years ago

Owner: Elrond removed
Status: in_progressaccepted

Okay, I have no idea, what's going on here, I am completely out of the loop. Someone else should revisit this.

comment:6 by Loic Dachary, 8 years ago

Type: defectenhancement

comment:7 by Ben Sturmfels, 3 years ago

Resolution: no-action-required
Status: acceptedclosed

Closing this ticket - seems to be a low-priority enhancement. As far as I can see we're just using URLs in the feed.

Note: See TracTickets for help on using tickets.