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

behavior of commands if both, a record and a draft, exist #51

Open
2 tasks
martinobersteiner opened this issue Sep 7, 2023 · 0 comments
Open
2 tasks

Comments

@martinobersteiner
Copy link
Contributor

as the title states, this concerns behavior of commands when given a --pid to which there exists both, a record and a draft
for example, updating the JSON in the database in this case has (at least) the following considerations:

  • a draft might have been created by a user
  • the draft might differ from the record in many ways
    • this includes the draft having updated part of the JSON relevant to the command
    • a draft's JSON is also allowed to be malformed or unfinished (it is just a draft after all)
  • so which JSON should be used to update upon? The one from draft or the one from record?

handling all these possible cases automatically seems difficult, if a generalized solution exists at all
this case is probably rare though

so suggested course of actions is:

  • make sure all commands use get_<thing> functions provided by this package for getting stuff from database
  • make relevant get_<thing> functions raise when a draft exists, requiring the CLI-user to first publish/remove it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant