While extending the comments controller test coverage in (pull request https://github.com/otwcode/otwarchive/pull/2734), we found the following issue.
Steps to reproduce
Log in as testy, who has archivist privileges and can thus add anyone as a co-creator
Post a work with a co-creator, and turn on comment moderation for the work
Log out as testy and leave a few comments on the work
Log back in as testy and return to the work
Follow the “Unreviewed Comments” link on top of the work, but don’t do anything yet
Now, still logged in as testy, open another another tab or browser window and go to the work
Follow the “Edit” link on the work and choose the “Remove Me as Co-Creator” option
Now that you are no longer a creator of the work, switch back to the tab/window where you opened the Unreviewed Comments page
Press “Approve All Unreviewed comments”
A 500 error.
What should happen
You should be redirected to the homepage or the page you were previously on with a red flash message saying, "What did you want to review comments on?"
Followed steps to reproduce. No 500 error happened! Yay! \o/ However…
I was redirected to my Dashboard page instead of the Archive homepage. Wasn’t sure if this was intended behavior, so reporting it just in case. See attached screenshot.
Thanks for pointing that out! It is indeed expected behavior: the redirect should take you to either the page you were previously on or the homepage, if it can’t figure out where you were before. I’ll update the issue to reflect that.
Followed listed instructions. The red (well, blue since testy uses Reversi) “What did you want to review comments on?” message is shown, though I was directed back to the page of the work/the Proceed page, not the homepage. Going back a page does bring one back to the Unreviewed Comments page but any action from there kicks you back out (back 2 pages: what did you want to review comments on message, refresh: you do not have permission message, approve single comment: 404 page).
Also tested removing a co-creator who was not testy, same results.