Skip to content

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

Description

@Victor-w-Madeira

Follow-up from #1336 / PR #1339, which fixed a real flake but did so by hand-rolling a mechanism the repo already owns.

What landed

auto-save-off.spec.ts re-opens the flow under test through a local reopenFlow:

const flowLoaded = page.waitForResponse(/* GET /api/v1/flows/{id} 200 */);
await page.goto(`/flow/${flowId}`);
await flowLoaded;
await page.waitForSelector('[data-testid="canvas_controls_dropdown"]');

That is correct as far as it goes, and it is validated — but it duplicates helpers/flows/open-flow-by-id.ts (#1214), whose whole reason for existing is that this block "was hand-copied into three specs and had already diverged on every axis that matters". This is a fourth copy, added by the very PR that was fixing a parallel-safety bug of the kind that helper documents.

What the copy is missing

Two guarantees, both relevant to this spec:

Care needed in the migration (do not just swap the call)

The local copy waits for GET /api/v1/flows/{id} before touching the canvas, and that wait is load-bearer for a specific assertion: the discard check is div-generic-node count === 0, which passes vacuously if it reads a canvas whose graph has not been applied yet. openFlowById gates on canvas_controls_dropdown + writability, which does not by itself prove the graph was applied. So the flow-load wait has to survive the migration (register the response promise, call openFlowById, then await it) — or be replaced by something that provably orders the count after the graph.

Done when

Metadata

Metadata

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions