Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database and UI doesn’t always reflect state of published content #660

Open
1 of 4 tasks
paulrobertlloyd opened this issue Sep 13, 2023 · 1 comment
Open
1 of 4 tasks
Assignees
Labels
bug Something isn't working core Core indiekit package enhancement New feature or request plugin-store Store plug-in
Milestone

Comments

@paulrobertlloyd
Copy link
Collaborator

paulrobertlloyd commented Sep 13, 2023

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

  1. store.createFile methods should return the file location of the stored file, not true
  2. 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
  3. 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

  1. store.updateFile methods should return the updated file location of the stored file, not true
  2. 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

  1. store.deleteFile returns a boolean true (no change)
  2. 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?

@paulrobertlloyd paulrobertlloyd added the bug Something isn't working label Sep 13, 2023
@paulrobertlloyd paulrobertlloyd self-assigned this Sep 13, 2023
@paulrobertlloyd paulrobertlloyd added this to the v1.0 milestone Sep 13, 2023
@paulrobertlloyd paulrobertlloyd added enhancement New feature or request plugin-store Store plug-in core Core indiekit package labels Sep 13, 2023
@paulrobertlloyd paulrobertlloyd changed the title Database doesn’t always reflect state of published content Database and UI doesn’t always reflect state of published content Sep 13, 2023
@paulrobertlloyd
Copy link
Collaborator Author

Work in progress, showing store status in UI:

Screenshot 2023-10-21 at 23 35 25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Core indiekit package enhancement New feature or request plugin-store Store plug-in
Projects
None yet
Development

No branches or pull requests

1 participant