mengw15 commented on code in PR #7392:
URL: https://github.com/apache/texera/pull/7392#discussion_r3753695057
##########
frontend/src/app/workspace/component/menu/menu.component.ts:
##########
@@ -999,7 +999,22 @@ export class MenuComponent implements OnInit, OnDestroy {
this.workflowActionService
.getWorkflowModificationEnabledStream()
.pipe(untilDestroyed(this))
- .subscribe(modifiable => (this.isWorkflowModifiable = modifiable));
+ .subscribe(modifiable => {
+ this.isWorkflowModifiable = modifiable;
+ // A generation started from the workflow dashboard has no canvas to
run on, so the
+ // dashboard defers it here: once this freshly created workflow is
loaded and editable,
+ // pick up the handoff and run the same pipeline the toolbar button
uses. consumePending-
+ // Generation guards by wid and clears on consume, so this fires once
for its workflow.
+ if (modifiable && this.pythonNotebookMigrationEnabled) {
+ const wid = this.workflowActionService.getWorkflowMetadata().wid;
+ if (wid !== undefined) {
+ const pending =
this.notebookMigrationService.consumePendingGeneration(wid);
Review Comment:
`consumePendingGeneration` leaves the slot armed on a wid mismatch, so a
handoff that misses its window — the user backs out of the workspace before
this subscription fires, or the load fails into the error branch where the wid
guard skips the consume — survives for the rest of the SPA session. If the user
later edits that still-empty workflow and reopens it, the stale generation
fires with no confirm (this path skips `confirmAndImport`) and overwrites the
edits.
Not blocking: clearing the slot on wid mismatch (the user demonstrably
opened a different workflow after the handoff was set) would bound its lifetime
to the next workspace load instead of the whole session.
--
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]