RSS Item guid changed when the item title is updated


(Camille Roux) #1

Currently, the guid is the URL of the item. But when the title is updated, the url changed too.
So, if you use a service like Twitterfeed, your discussion we’ll be post twice.

PS : Moreover, for this use, it should be better to sort them by creation date instead of update date.


(Jeff Atwood) #2

Agreed the GUID should be topic id plus site title or something like that. Can you look tomorrow @neil?


(Alexander) #3

Nice catch @CamilleRoux.

There’s a /t/:id route for topics which seems the most appropriate, since it doesn’t have any room for name-like things that a person might be tempted to change.

(However, the JS doesn’t seem to like that route. The HTML is served with a 200, and the page title shows the topic’s subject temporarily, but when everything is done loading it shows “The page you requested doesn’t exist or is private.” for example this: https://meta.discourse.org/t/15201 should take you back to this topic.)

Having /t/:id work as a guid seems like a fair idea to me, but then it implies that individual posts within a topic should have guids like /t/:topic_id/:post_id but I think that’ll get in the way of the “normal” route for topics (/t/:topic_slug/:topic_id).

Another option is to have very explicitly-guid-looking guids, like /guid/topic/:id and /guid/post/:id.


(Neil Lalonde) #4

The guid doesn’t have to be a URL (according to the internet). We provide the <link> element for that.

So we could use simple guids like this:

<guid isPermaLink="false">topic-123</guid>

(Alexander) #5

Ah, I like that much better.


(Neil Lalonde) #6

Unfortunately this will cause all the topics to be duplicated in people’s rss feed readers because all the guid’s will change… But I don’t see a way to avoid that. Sorry! :maple_leaf: (that’s supposed to be a maple leaf…)


(Alexander) #7

Was just about to get into this but you already committed! :+1:


(Camille Roux) #8

To preserve compatibility with existing guid, you could maybe save the current guid in database in order not to change it when the item title is updated.


(Camille Roux) #9

Is it possible to sort topics by creation date instead of update date? (to avoid duplicates)


(Neil Lalonde) #10

Oh right, good idea. It is done.


(Jeff Atwood) #11

This topic was automatically closed after 24 hours. New replies are no longer allowed.