Repository navigation
fix(api): await restoreDeletedId in snippet controllers - #678
Conversation
|
Thanks for catching this — the fix is correct and I'd like to merge it. Would you be up for adding one regression test? The existing it('restore a non-existent snippet id should return 404', async () => {
await client
.patch('/basesnippets/000000000000000000000000/restore')
.set('Authorization', 'Bearer ' + token)
.set('Content-Type', 'application/json')
.expect(404);
});It slots into |
Without the await the rejected promise never reaches the request, so restoring an unknown id answered 204 instead of 404.
|
added it, thanks for writing it out and running it - it fails with 204 and passes with the await, exactly as you said. i also put the same case in the location, logbook, paragraph and task acceptance files, since the fix touches those five controllers and only basesnippet would have been covered otherwise. happy to drop the extra four if you'd rather keep it to one. |
02d74c8
## [2.11.4](v2.11.3...v2.11.4) (2026-08-20) ### Bug Fixes * **api:** await restoreDeletedId in snippet controllers ([#678](#678)) ([02d74c8](02d74c8))
|
🎉 This PR is included in version 2.11.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
The snippet controllers called an async restore operation without awaiting it, so the response could return before the restore finished and any failure became an unhandled rejection. This awaits the call.