internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.15k stars 1.35k forks source link

Edition revisions with zero changes being created #6017

Open tfmorris opened 2 years ago

tfmorris commented 2 years ago

The work edit referenced in bug report #6016 caused an edition revision with no changes to be created unnecessarily. This confuses the provenance and edit history when someone is listed as having modified the record when they didn't.

Evidence / Screenshot (if possible)

Screen Shot 2021-12-27 at 7 13 16 PM

Relevant url?

https://openlibrary.org/books/OL27504584M/Some_Answered_Questions?_compare=Comparer&b=2&a=1&m=diff

Steps to Reproduce

  1. Go to ...
  2. Do ...

Details

Proposal & Constraints

Related files

Stakeholders

mekarpeles commented 2 years ago

@tfmorris do you have any suggestions on what the characteristics of a solution might look like which closes this issue?

Should it be that edits should be rejected which make no change?

tfmorris commented 2 years ago

I should have made it clearer that the original edit was a work edit and it created an empty edition revision.

The general fix is for "edits" which don't change anything to not create a new revision. The API might return a 304 Not Modified and the UI might display a warning to the user (since they presumably didn't intend this).

The specific fix is to not shoot yourself in the foot by creating an identical edition revision when the user only edited work metadata (e.g. author)