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

Fix underlying bug whereby duplicate draft sections (and possibly manuals?) can be incorrectly created in database #1114

Open
floehopper opened this issue May 18, 2017 · 2 comments
Milestone

Comments

@floehopper
Copy link
Contributor

floehopper commented May 18, 2017

This follows on from Check or remove delete_documents_marked_for_delete, delete_duplicate_drafts & find_duplicate_documents scripts.

Reading the note for the commit where the code for the delete_duplicate_drafts rake task was introduced, it's clear this script is working around an underlying problem in the application where a new draft is rejected by the Publishing API, but still saved to the local database.

Similarly the note for the commit where the code for the delete_sections_marked_for_delete rake task was introduced, it's clear that this script is dealing with a workaround which editors have been using for the same problem.

Similarly the note for the commit where the code for the find_duplicate_documents rake task was introduced, talks about an underlying bug.

We should fix the underlying problem so we can remove these scripts!

I also notice that there is a chunk of duplication between these three rake tasks in finding the duplicates.

@floehopper floehopper added this to the Scripts milestone May 18, 2017
@floehopper floehopper changed the title Fix underlying bug whereby duplicate draft sections can be incorrectly created in database Fix underlying bug whereby duplicate draft manuals/sections can be incorrectly created in database May 18, 2017
@floehopper floehopper changed the title Fix underlying bug whereby duplicate draft manuals/sections can be incorrectly created in database Fix underlying bug whereby duplicate draft sections (and possibly manuals?) can be incorrectly created in database May 18, 2017
@floehopper
Copy link
Contributor Author

I notice that the update actions for both manual and section result in the relevant models being saved to the local database before they are sent to the Publishing API:

I imagine fixing the underlying problem will mean only saving models to the database if the calls to the Publishing API return successfully - whatever that means.

@chrisroos
Copy link
Contributor

I've added issue #1120 to capture the problem experienced when creating multiple manuals with the same title. That might be related to this issue.

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

2 participants