Currently, if you create/update/delete a post, and the content store throws an error, Indiekit doesn’t reflect this in post data, and shows a post as published; post data does not always reflect the current state of a post in the content store.
As part of ensuring the robustness of Indiekit’s data, consider the following:
Creating a post
store.createFile methods should return the file location of the stored file, not true
- On receipt of a file location, update a post‘s properties:
- add
storeProperties.published with date if successful, false if failed.
- add
storeProperties.url and storeProperties.path
- Show the post in the UI with the ‘Published’ state.
If an error occurs storing content, a post will have false for store.published. We already show an error message, can now show a ‘Not stored’ status, or similar.
Updating a post
store.updateFile methods should return the updated file location of the stored file, not true
- On receipt of a file location, update a post‘s properties:
- add
storeProperties.updated with date if successful, false if failed.
- update
storeProperties.url and storeProperties.path if relevant
If an error occurs storing content, a post will not have the properties.updated property. We already show an error message but can now show ‘Updates not stored’ status, or similar.
Deleting a post
store.deleteFile returns a boolean true (no change)
- On receipt of
true, update a post‘s properties:
- add
storeProperties.deleted with date if successful, false if failed.
- delete
storeProperties.url
If an error occurs storing content, a post will not have a store.deleted property and will show an error message. We already show an error message but can now show ‘Not deleted from store’ status, or similar.
To do
On these last 2, perhaps it’s less a case of providing explicit statuses, but providing a persist message on any post that has encounter issues while being saved to the content store, with an option to retry the last action?
Currently, if you create/update/delete a post, and the content store throws an error, Indiekit doesn’t reflect this in post data, and shows a post as published; post data does not always reflect the current state of a post in the content store.
As part of ensuring the robustness of Indiekit’s data, consider the following:
Creating a post
store.createFilemethods should return the file location of the stored file, nottruestoreProperties.publishedwith date if successful,falseif failed.storeProperties.urlandstoreProperties.pathIf an error occurs storing content, a post will have
falseforstore.published. We already show an error message, can now show a ‘Not stored’ status, or similar.Updating a post
store.updateFilemethods should return the updated file location of the stored file, nottruestoreProperties.updatedwith date if successful,falseif failed.storeProperties.urlandstoreProperties.pathif relevantIf an error occurs storing content, a post will not have the
properties.updatedproperty. We already show an error message but can now show ‘Updates not stored’ status, or similar.Deleting a post
store.deleteFilereturns a booleantrue(no change)true, update a post‘s properties:storeProperties.deletedwith date if successful,falseif failed.storeProperties.urlIf an error occurs storing content, a post will not have a
store.deletedproperty and will show an error message. We already show an error message but can now show ‘Not deleted from store’ status, or similar.To do
storeProperties.*properties after file storage actionOn these last 2, perhaps it’s less a case of providing explicit statuses, but providing a persist message on any post that has encounter issues while being saved to the content store, with an option to retry the last action?