Reviews not saving if decision already started
Observed on release 1.4.0, using database dump from Aperture. To reproduce:
- Upload a manuscript (can be docx or URL; filling in fields and submitting is not necessary to reproduce the error)
- Go to decision page and submit a decision, or even just type some text in the decision comment field.
- Now assign yourself as reviewer, go to your dashboard, accept the invite and "Do Review".
- Type into a field of the review form and you'll see an error in the console:
In the server logs:
server_1 | error: undefined was passed to findById message=undefined was passed to findById, locations=[line=2, column=3], path=[updateReview], code=INTERNAL_SERVER_ERROR, stacktrace=[Error: undefined was passed to findById, at assertIdNotUndefined (/home/node/app/node_modules/objection/lib/utils/assert.js:18:11), at FindByIdOperation.onBuild (/home/node/app/node_modules/objection/lib/queryBuilder/operations/FindByIdOperation.js:22:7), at QueryBuilder.callOperationMethod (/home/node/app/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js:379:33), at /home/node/app/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js:478:14, at QueryBuilder.forEachOperation (/home/node/app/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js:316:37), at QueryBuilder.executeOnBuild (/home/node/app/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js:476:10), at callOnBuildHooks (/home/node/app/node_modules/objection/lib/queryBuilder/QueryBuilder.js:1575:11), at doExecute (/home/node/app/node_modules/objection/lib/queryBuilder/QueryBuilder.js:1452:13), at QueryBuilder.execute (/home/node/app/node_modules/objection/lib/queryBuilder/QueryBuilder.js:667:28), at runMicrotasks (<anonymous>), at processTicksAndRejections (internal/process/task_queues.js:97:5), at async updateReview (/home/node/app/server/model-review/src/graphql.js:16:31), at async middleware (/home/node/app/node_modules/graphql-shield/dist/generator.js:30:24)]
If you reload the page your changes are gone.
Expected behaviour: the changes should persist.