HermanMartinus / bearblog

Free, no-nonsense, super fast blogging.
MIT License
2.39k stars 73 forks source link

Unstable Feed IDs. #158

Closed kevincox closed 1 year ago

kevincox commented 1 year ago

Right now the entry IDs in feeds appear to change for a variety of reasons. For example I just got a load of duplicate articles from my feed reader because of a switch like:

-<id>http://herman.bearblog.dev/hello-world/</id>
+<id>https://herman.bearblog.dev/hello-world/</id>

It also appears that these IDs may change if a user switches to a custom domain. Ideally this IDs would be globally unique and forever stable. Using a URL (as recommended for Atom) helps with the global uniqueness but makes it easier to accidentally change them.

I see a few main options for this:

  1. Always use an ID such as https://{user}.bearblog.dev/{slug}/ independent of http/https or a custom domain. (also don't let users change the slug)
  2. Generate the ID at initial publish and continue to use it in the feed even if something about the URL structure changes.
  3. Use a UUID like urn:uuid:f4a3ca5b-5799-44e8-aaaa-e40728f037d3.

(Note, when fixing this issue please be careful to not change the ID of existing entries)

HermanMartinus commented 1 year ago

My bad, I didn't think about the consequence of using the url as an id and making the switch globally to https. I'll give your options some consideration. Thanks for taking the time to report this.

HermanMartinus commented 1 year ago

Feed ids are stable with https://{user}.bearblog.dev/{slug}/

I'm not going to be migrating to a generated ID or UUID (although this would have possibly been best to begin with) since it will either affect existing accounts or will be side-by-side another format which just rankles me the wrong way.

This should be good going forward.