openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Adding authors to works sometimes fails on "expected /type/author, found /type/redirect" and edits are lost

Open bilch opened this issue 1 year ago • 1 comments

Problem

Some books (e.g. anthologies) have lots of authors. When I've added many authors to a work and try to save, the save sometimes fails on the error message "expected /type/author, found /type/redirect". All edits are lost, and the error message doesn't say which author caused the problem.

Reproducing the bug

I believe this might be reproduced by

  1. adding an author to a work (but not saving yet)
  2. merging this author with others
  3. and only then saving the work that the author was added to.

(Although it happens in other cases, too. This is merely what I think might be easiest to reproduce.)

  • Expected behavior: Show me an error message that says "These edits couldn't be saved because there is a problem with author x, please try again" and do not send me back to a page that lost all my edits.
  • Actual behavior: Edits are lost, no helpful error message.

Context

  • Browser (Chrome, Safari, Firefox, etc): Firefox
  • OS (Windows, Mac, etc): Linux (Ubuntu)
  • Logged in (Y/N): yes
  • Environment (prod, dev, local): prod

Breakdown

Minimal solution: Take me back to the edit page in such a way that my edits are not lost. Would be nice to have: Tell me which author is causing the problem.

Requirements Checklist

  • [ ]

Related files

Stakeholders


Instructions for Contributors

  • Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.

bilch avatar Oct 03 '24 09:10 bilch

This is a result of unresolved redirects. The same problem that causes some merges to fail.

seabelis avatar Oct 03 '24 09:10 seabelis

Hi @jimchamp @seabelis, I'd like to work on this. Planning to implement the minimal solution (preserve edits + better error messages). Is that acceptable, or would you like redirect auto-resolution included too?

akramcodez avatar Dec 16 '25 05:12 akramcodez