Copilot commented on code in PR #8540:
URL: https://github.com/apache/texera/pull/8540#discussion_r4088427727


##########
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:
   A graph edit can arrive after the switch save completes but while 
`whenSavesDrained()` is waiting for a queued rename/description save. That edit 
sets `editedSinceSwitchSnapshot`, but this callback navigates without checking 
it, so the debounced autosave can be enqueued only during teardown and its 
failure is no longer reported on the canvas. Recheck the flag when the drain 
emits and perform another hand-over save before routing; a regression test 
should cover an edit made during this drain-wait window.



-- 
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]

Reply via email to