Database can fall out of sync with published posts if publication configuration changes #575
Open
1 of 4 tasks
Labels
bug
Something isn't working
code quality
Making things easier to understand
core
Core indiekit package
plugin-syndicator
Syndicator plug-in
Milestone
Lots of things can change over the course of a post’s lifetime:
publication.me
publication.slugSeparator
publication.postTypes
path
properties.published
properties.slug
properties.url
TLDR: Changing any post property will update a post’s record in the database, but changing any
publication
value will not. Aspublication
configuration can affect post paths and URLs, a post’spath
orproperties.url
value is not authoritative.Currently Indiekit looks for posts based on a given URL. After all, that’s the information provided in a Micropub
update
ordelete
action. However, there are a few scenarios where this causes problems.Syndicating posts
The syndication endpoint can be asked to syndicate a given URL. If a post with that URL is found in the database, and that post can be syndicated, it will be syndicated.
The syndication endpoint also allows for the last post awaiting syndication to be found.
As part of the update process, besides adding the new
syndication
URLs, all post properties are updated - includingpath
andproperties.url
. Should anypublication
value have changed, when Indiekit comes to look for a post in the database with the new URL/path, it won’t be found.Given the following scenario, with syndication plugins for Twitter and Mastodon installed, and the Netlify deploy hook configured, a site will be continually republished:
publication
values, and a file with the updated properties is published.(See: #569)
Changing a post slug
I came across a similar issue when changing the post slug on a published post. I suspect the above issue was partly to blame.
Potential options to resolve
_id
(internal Indiekit operation)This is a fairly consequential (existential!) issue with the design of Indiekit. If you don’t change anything in your publication settings, all will remain well, yet in the early stages of experimenting with the product, lots of settings can and will be changed, meaning this issue is more likely to appear, and thus reducing trust in the robustness of this software.
The text was updated successfully, but these errors were encountered: