Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994285623
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +548,18 @@ export class WorkflowFormComponent implements OnInit,
OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties
are read-only
- * on this page. A later PR's authoring mode makes properties editable with
write access.
+ * Lock or unlock editing: the graph and its properties are read-only unless
a writer is in edit
+ * mode, which is the only state that unlocks them (see toggleAuthoring).
*/
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ // Edit mode with write access is the only state that makes the operator
properties (and the
+ // embedded canvas) modifiable here; every other state locks them, so a
reader -- or a writer
+ // just viewing -- cannot change the workflow through this page.
+ if (this.authoring && this.canEdit) {
Review Comment:
Entering Edit while a run is already in progress re-enables workflow
modification here, undoing `ExecuteWorkflowService`'s running-state lock. The
Edit button remains enabled during execution, so this lets the live property
panel and view-result command mutate the workflow mid-run, contrary to the
stated canvas lock behavior. Keep modification disabled until the run reaches a
terminal state.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -1278,11 +1451,24 @@ export class WorkflowFormComponent implements OnInit,
OnDestroy {
* of yourself, broken runs. A fresh document is the reliable handover.
*/
public openRegularCanvas(): void {
- this.save();
- /* v8 ignore start -- full-document navigation; jsdom cannot navigate */
+ // Save first and hand over only once the save has completed: the
full-page load unloads this
+ // document, and a request still in flight at that moment is aborted, so
navigating right after
+ // firing the save could lose the very edit the switch is meant to carry
across. A save that
+ // fails keeps the author here with the error shown, rather than leaving
with changes that were
+ // never stored. A reader, who has nothing to save, goes straight over.
+ this.save(() => this.openCanvasPage());
Review Comment:
This waits for the newly started save, but it does not coordinate with an
autosave already in flight. Under a slow/out-of-order network, an older
autosave can reach the backend after this latest snapshot and overwrite it;
navigation then proceeds because only this request completed. Serialize/flush
persistence requests and navigate only after the latest queued snapshot is
committed.
--
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]