yangzhang75 commented on code in PR #8540:
URL: https://github.com/apache/texera/pull/8540#discussion_r4088524308
##########
frontend/src/app/workspace/component/menu/menu.component.ts:
##########
@@ -772,8 +777,18 @@ export class MenuComponent implements OnInit, OnDestroy {
this.saveThenOpenFormView(target);
return;
}
- this.isSaving = false;
- this.openFormViewPage(target);
+ // A save queued behind ours (a rename's, a description's: those
save through the menu
+ // itself, not the autosave) answers to this component: its error is
shown here, its
+ // response fed back here, and neither reaches a component the route
has destroyed. Leave
+ // once it has answered; a failure of its own is reported by its
caller and does not hold
+ // the hand-over.
+ this.workflowPersistService
+ .whenSavesDrained()
+ .pipe(untilDestroyed(this))
+ .subscribe(() => {
+ this.isSaving = false;
+ this.openFormViewPage(target);
+ });
Review Comment:
Right, the wait for the queue was a second window the flag check did not
cover. Fixed in e6ca835bf: the check now sits in the drain's callback, after
the wait; `whenSavesDrained` emits at once when nothing is queued, so the one
check covers both windows, and an edit found there saves once more and drains
again before routing. Regression test added: an edit reported between the
switch's save completing and the drain emitting is saved a second time, and the
hand-over leaves only after that save's own drain (fails with the check back
where it was).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]