0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Revert "Added drop of intermediate post saves between current running and latest triggered" (#17978)

reverts TryGhost/Ghost#17912

- unfortunately dropping save tasks when one is already running has side-effects for code that is initiating the save tasks
- e.g. the slug or title update actions call `saveTask.perform()` and if that related save request fails they expect to get a standard request error so they can show a message and perform a model rollback. However with `keepLatest` the save task can be dropped and "fail" immediately with a `TaskCancelation` error which has unintended side-effects:
  1. error handling is no longer tied to the specific request meaning we could have slug-related failures being handled by non-slug-save code which is unexpected
  2. the internal `TaskCancelation` error is handled as if it was general error and we end up showing a useless error in the red error bar that makes it look like something failed when it didn't
  3. we initiate a model rollback when we do not have a failure situation that requires it meaning we can lose changes
This commit is contained in:
Kevin Ansfield 2023-09-05 14:38:59 +01:00 committed by GitHub
parent d3db3b32d2
commit d00f437cf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -149,7 +149,7 @@ export default class EditorController extends Controller {
// cursor is in the slug field - that would previously trigger a simultaneous
// slug update and save resulting in ember data errors and inconsistent save
// results
@(taskGroup().keepLatest())
@(taskGroup().enqueue())
saveTasks;
@mapBy('post.tags', 'name')

View file

@ -153,7 +153,7 @@ export default class LexicalEditorController extends Controller {
// cursor is in the slug field - that would previously trigger a simultaneous
// slug update and save resulting in ember data errors and inconsistent save
// results
@(taskGroup().keepLatest())
@(taskGroup().enqueue())
saveTasks;
@mapBy('post.tags', 'name')