yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994375447
##########
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:
Agreed. 6ae880ae0 puts every save through one serial queue (concatMap): the
switch's save is sent only after an autosave already in flight has completed,
snapshots the workflow when its turn comes, and navigation waits for that save;
a failed save reports itself and does not stop the queue. Specs: the ordering
with two in-flight persists, the failed-then-successful sequence, and the
destroy-time save.
##########
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:
Right, and there was a second unlocker besides the execute service: the
embedded computing-unit selector re-enables modification when it finds no run
on the chosen unit. 6ae880ae0 makes one reducer (edit mode, write access, and
no run in flight) and clamps on getWorkflowModificationEnabledStream():
whenever anything unlocks the graph while the page must stay locked, it is
locked again. Entering edit mode mid-run therefore stays locked until the run
ends; in edit mode the execute service's unlock after the run stands. Specs
cover all three transitions.
--
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]