RssItemUniqueUriPatch for Thunderbird

This patch changes the unique identifier for RSS feed items. The unique identifier is used for storing feed items and for detecting duplicate entries.

Thunderbird's default behavior is to use the (required) link element for identifying feed items - even if the item provides an (optional) guid (global unique identifier) element. This may lead to problems if the RSS feed contains multiple entries with the same link, for example in case of a RSS feed reporting updates of web sites (e.g. changes to a wiki). The patch fixes this behavior.

Download

For Thunderbird 1.5.x: rss-itemuniqueuri-patch.xpi (version 0.1)

Installation

The patch is deployed as a Thunderbird extension. For installation, download the XPI file, and install it via the Extension Manager (Menu "Tools" > Entry "Extensions"). Detailed instructions on how to install can be found at the MozillaZine Knowledge Base.

Known Issues

The first time after installing (or uninstalling) the patch, it is very likely that duplicates will occur in already subscribed feeds. The reason is that the retrieved feed items will now get an identifier using the new scheme whereas the already stored entries still have an old identifier. The patch does not try to detect such duplicates.


What is the extension patch doing?

The extension patch overlays operation get itemUniqueURI() in the FeedItem.js script, which is contained in the newsblog.jar in Thunderbird's chrome directory.

The original method definition is

  get itemUniqueURI()
  {
    var theURI;
    if(this.isStoredWithId && this.id)
      theURI = "urn:" + this.id;
    else
      theURI = this.mURL || ("urn:" + this.id);
    return theURI;
  },

The extension patch changes it into

  get itemUniqueURI()
  {
    var theURI;
    if(this.isStoredWithId && this.id)
      theURI = "urn:" + this.id;
    else if (this.mURL && this.id)
      theURI = this.mURL + '#' + this.id
    else
      theURI = this.mURL || ("urn:" + this.id);
    return theURI;
  },