inveniosoftware / invenio-rdm-records

DataCite-based data model for InvenioRDM flavour.
https://invenio-rdm-records.readthedocs.io
MIT License
15 stars 81 forks source link

Fix duplicate drafts on user dashboard after direct publish #1734

Closed slint closed 2 months ago

slint commented 2 months ago
slint commented 2 months ago

Just a note, this fix has the caveat that we'll index the draft and then delete it right after, which is a waste.

What I had in mind though is that this is not the first place where we might be doing this (on purpose or accidentally) and we discussed that the right way to fix would be to have some sort of "roll-up" logic in the Unit of Work which e.g. knows the entire set of operations and might be smart enough to "skip index/update before delete", "avoid sending duplicate notification emails", etc.