Added drop of intermediate post saves between current running and latest triggered (#17912)

no issue

- every triggered save was being added to a queue resulting in an unnecessary number of requests in some circumstances because it means every triggered save would be run sequentially even though the intermediate saves could be safely thrown away if we're still waiting on a response to a previous one
- switched from a standard queue to ember-concurrency's `keepLatest` behaviour
  - drops intermediate saves if multiple saves are triggered whilst still waiting on a previous save
  - http://ember-concurrency.com/docs/task-concurrency#keepLatest
This commit is contained in:
Kevin Ansfield 2023-08-31 16:18:02 +01:00 committed by GitHub
parent de13a7ff65
commit ca6e7dfb88
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().enqueue())
@(taskGroup().keepLatest())
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().enqueue())
@(taskGroup().keepLatest())
saveTasks;
@mapBy('post.tags', 'name')