Skip to content

fix(flow-functionality): enter the flow through openFlowById (#1342) - #1343

Merged
Victor-w-Madeira merged 1 commit into
mainfrom
fix/issue-1342-auto-save-off-use-open-flow-by-id
Aug 7, 2026
Merged

fix(flow-functionality): enter the flow through openFlowById (#1342)#1343
Victor-w-Madeira merged 1 commit into
mainfrom
fix/issue-1342-auto-save-off-use-open-flow-by-id

Conversation

@Victor-w-Madeira

Copy link
Copy Markdown
Collaborator

Fixes #1342. Closes #1342.

Problem

#1336's fix re-opened the flow under test with a local page.goto('/flow/{id}') plus a canvas wait. It works and it is validated — but it is the fourth copy of the block helpers/flows/open-flow-by-id.ts (#1214) was extracted to stop, added by the very PR that was fixing a parallel-safety bug of the kind that helper documents. Self-reported debt, not a review catch.

Two guarantees the copy did not have, both live for this spec:

Fix

Both re-opens now enter through openFlowById. Two deliberate details:

  • The seed is called at the top of the test, not left to the helper's own call. addInitScript applies only to loads that follow it, and the first editing phase — two adjustScreenView calls plus the on-canvas save click — happens before any re-open, inside the mount + 10 s window.
  • The wait on the flow's own GET /api/v1/flows/{id} stays. This is the part the issue flagged as needing care and it is load-bearing: openFlowById returns on canvas_controls_dropdown + writability, and neither implies the graph has been applied. The discard assertion (div-generic-node count === 0) is the one check that passes vacuously on a canvas that has not painted its nodes yet, so the count is ordered after that GET. The response promise is registered before the helper's navigation and awaited after it.

Scope note

No assertion changed; no change to the exit path (expectLeftEditor is untouched — leaveFlowEditor is not applicable here, it is built for autosave mode where the blocker dialog renders no buttons, whereas this spec must deliberately click "Exit Anyway" / "Save And Exit", which is the behaviour under test).

Validation (nightly 1.12.0.dev18, --retries=0)

  • npm run typecheck ✅ · npx eslint <spec> ✅ (0 errors)
  • 3/3 and 2/2 clean serial runs; zero 🚨 Backend Error
  • 8/8 under --workers=4 --repeat-each=8 — the burst that produced 3/8 failures before [Daily #1330] auto-save-off — reopening the just-created flow's card intermittently times out at 45 s (recurrent 2×) #1336's fix ✅
  • No leak: 27 flows before and after, 0 New Flow orphans ✅
  • Force-fails, executed:
    • expect(chatInputNode).toBe(0)toBe(1) ⇒ failed (Expected: 1, Received: 0) — the discard assertion the issue asked to re-prove is still falsifiable through the new entry
    • expect(nodeCount).toBe(2)toBe(3) ⇒ failed (Expected: 3, Received: 2)
    • identity: every re-open pointed at the bootstrap placeholder id (deleted by Langflow) ⇒ failed in both layers — the flow-GET gate at 45 s and the helper's own canvas_controls_dropdown assertion (element(s) not found), with the 404 logged
    • mutations reverted (grep → 0 hits) + final green run ✅

Stated rather than claimed: the placement of seedAssistantDiscovered at the top of the test is not independently falsifiable by a test — the tooltip fires at mount + 10 s and only sometimes intercepts, so no deterministic mutation proves it. It rests on #1220's measurement (a 282×32 px opaque element at z-index: 40, pointer-events: auto, over the canvas-controls bar) plus the fact that this spec is still clicking that bar past the 10 s mark.

#1336's fix re-opened the flow under test with a local `page.goto('/flow/{id}')`
plus a canvas wait. That works and was validated, but it is the fourth copy of
the block `helpers/flows/open-flow-by-id.ts` (#1214) was extracted to stop —
added, ironically, by the PR that was fixing a parallel-safety bug of exactly
the kind that helper documents.

Two guarantees the copy did not have, both of which apply here:

- the onboarding overlay cannot appear. Upstream arms the assistant tooltip at
  canvas mount + 10 s and paints it over the canvas-controls bar, which is what
  `adjustScreenView` clicks (#1220's measurement). This test calls it four
  times across a ~15-25 s run. The CI artifact that opened #1336 shows that
  tooltip painted over the canvas.
- the editor is not handed back while POST /api/v1/authz/me/permissions is
  still in flight — the #1005 window in which a mutation is silently swallowed.
  This spec adds a component immediately after two of the three re-opens.

The seed is called at the top of the test rather than left to the helper's own
call: `addInitScript` only applies to loads that follow it, and the first
editing phase (two `adjustScreenView` calls plus the on-canvas save) happens
before any re-open.

One thing deliberately does NOT come from the helper. The wait on the flow's own
GET /api/v1/flows/{id} stays, because `openFlowById` returns on
`canvas_controls_dropdown` + writability and neither implies the graph has been
applied — and the discard assertion (`div-generic-node` count === 0) is the one
check that passes VACUOUSLY on a canvas that has not painted its nodes yet.
Copilot AI lite review requested due to automatic review settings August 6, 2026 16:58
@Victor-w-Madeira Victor-w-Madeira added the follow-up Approved exception: follow-up of merged work (ROADMAP Intake) label Aug 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the “auto-save off” regression coverage to use the shared openFlowById navigation helper and proactively seed the assistant onboarding flag to prevent UI interference/flakiness during repeated re-opens.

Changes:

  • Replace direct page.goto('/flow/{id}') + selector wait with openFlowById, while preserving an explicit wait for GET /api/v1/flows/{id} to ensure the graph is applied before node-count assertions.
  • Seed assistant onboarding state at the start of the test to avoid late-appearing overlays blocking adjustScreenView interactions.
  • Refresh the accompanying doc to reflect the new helper-based re-open flow and the rationale for the added gating.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/tests-automations/regression/flow-functionality/auto-save-off.spec.ts Uses openFlowById for consistent re-open behavior and seeds onboarding early to reduce UI flake.
docs/flow-functionality/auto-save-off.md Documents the helper-based re-open path and the onboarding seeding rationale.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Victor-w-Madeira
Victor-w-Madeira merged commit c8fc815 into main Aug 7, 2026
14 of 22 checks passed
@Victor-w-Madeira
Victor-w-Madeira deleted the fix/issue-1342-auto-save-off-use-open-flow-by-id branch August 7, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

follow-up Approved exception: follow-up of merged work (ROADMAP Intake)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auto-save-off re-opens the flow with a hand-rolled goto instead of openFlowById

2 participants