RSS feeds.Item.id is not a valid URL and is not isPermalink=false #12310

Closed
opened 2025-11-02 10:05:13 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @beaucollins on GitHub (Jan 8, 2024).

Description

When creating the RSS feed for releases, the Item.id is set to a db ID value with the url concatenated. Example:

      <guid>316519: https://gitea.com/owner/repo/releases/tag/v2.4.1rc1</guid>

f4ea8d9a6c/routers/web/feed/convert.go (L308)

The RSS 2 standard states:

guid stands for globally unique identifier. It's a string that uniquely identifies the item. When present, an aggregator may choose to use this string to determine if an item is new.

There are no rules for the syntax of a guid. Aggregators must view them as a string. It's up to the source of the feed to establish the uniqueness of the string.

If the guid element has an attribute named isPermaLink with a value of true, the reader may assume that it is a permalink to the item, that is, a url that can be opened in a Web browser, that points to the full item described by the element. An example:

isPermaLink is optional, its default value is true. If its value is false, the guid may not be assumed to be a url, or a url to anything in particular.

https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt

And since the default value of true indicates this is a valid URL gitea should provide a valid URL or set isPermalink="false".

Gitea's behavior of providing an invalid URL and leaving out the isPermalink="false" it breaks some feed readers that expect the <guid> to abide by the RSS 2.0 specification.

Gitea Version

1.22.0+dev-522-ga04f8c0f8

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

https://gitea.com/

Database

None

Originally created by @beaucollins on GitHub (Jan 8, 2024). ### Description When creating the RSS feed for releases, the `Item.id` is set to a db ID value with the url concatenated. Example: ``` <guid>316519: https://gitea.com/owner/repo/releases/tag/v2.4.1rc1</guid> ``` https://github.com/go-gitea/gitea/blob/f4ea8d9a6caa3118ded80b15e11b2e9a09d1a270/routers/web/feed/convert.go#L308 The RSS 2 standard states: > `guid` stands for globally unique identifier. It's a string that uniquely identifies the item. When present, an aggregator may choose to use this string to determine if an item is new. > > There are no rules for the syntax of a guid. Aggregators must view them as a string. It's up to the source of the feed to establish the uniqueness of the string. > > **If the guid element has an attribute named isPermaLink with a value of true, the reader may assume that it is a permalink to the item, that is, a url that can be opened in a Web browser**, that points to the full item described by the <item> element. An example: > > **isPermaLink is optional, its default value is true. If its value is false, the guid may not be assumed to be a url, or a url to anything in particular.** https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt And since the default value of `true` indicates this is a valid URL gitea should provide a valid URL **or** set `isPermalink="false"`. Gitea's behavior of providing an invalid URL and leaving out the `isPermalink="false"` it breaks some feed readers that expect the `<guid>` to abide by the RSS 2.0 specification. ### Gitea Version 1.22.0+dev-522-ga04f8c0f8 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? https://gitea.com/ ### Database None
GiteaMirror added the type/bug label 2025-11-02 10:05:13 -06:00
Author
Owner

@beaucollins commented on GitHub (Jan 8, 2024):

The package Gitea uses to create the RSS feeds does not seem to support setting isPermalink. Relevant issue https://github.com/gorilla/feeds/issues/78

Seems the simplest fix code wise would be to append the id as a URL fragment https://url.com/org/repo/feed#123456 but this would cause all existing feeds to indicate that the feed item is new since the GUID will have changed.

@beaucollins commented on GitHub (Jan 8, 2024): The package Gitea uses to create the RSS feeds does not seem to support setting `isPermalink`. Relevant issue https://github.com/gorilla/feeds/issues/78 Seems the simplest fix code wise would be to append the id as a URL fragment `https://url.com/org/repo/feed#123456` but this would cause all existing feeds to indicate that the feed item is new since the GUID will have changed.
Author
Owner

@yardenshoham commented on GitHub (Jan 9, 2024):

I mentioned this in https://github.com/go-gitea/gitea/pull/21550#issuecomment-1287854400

@yardenshoham commented on GitHub (Jan 9, 2024): I mentioned this in https://github.com/go-gitea/gitea/pull/21550#issuecomment-1287854400
Author
Owner

@github-actions[bot] commented on GitHub (Mar 1, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Mar 1, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12310