Repository navigation
Fixes 36362: Lineage node drag held at the canvas edge no longer crashes - #36901
Conversation
Controlled nodes sent every drag frame through React state and back into
React Flow's store. With auto-pan at the canvas edge that happened several
times per frame and could exceed React's nested-update limit ("Maximum
update depth exceeded"). Drag frames now update React Flow's store only,
and the final position is committed once on drop. Edges of the dragged
node are hidden until it is dropped.
…d-drag A change forwarded mid-drag (React Flow measuring a node auto-pan just revealed) made React Flow rebuild its store from the caller's nodes, which still held pre-drag positions, so the dragged node snapped back and a quick drop could save its start position. Such batches now carry the dragged nodes' current positions. Map the new lineage hook and edge files to the lineage Playwright specs.
…receives Any parent re-render mid-drag (a hover highlight on the platform map, a measured node) re-synced React Flow from nodes that still held pre-drag positions, snapping the dragged node back and letting the drop save its start position. The hook now remembers drag positions and overlays them on the nodes passed to <ReactFlow>, replacing the in-flight change patch. Record the drag contract as ADR:2026-11-03-lineage-node-drags-stay-in-react-flow-until-drop and test that the canvas skips only a dragged node's edges.
A touch drag aborted by a second finger never sends a drop, so its node kept an in-flight position and hidden edges. Each drag frame carries every node being dragged, so the drag positions are rebuilt per frame.
There was a problem hiding this comment.
🟡 Changes recommended
A cancelled touch drag leaves the previous node marked as dragging when another drag starts, keeping its edges hidden until a parent resync; the live-store update and cancellation regression need to clear and verify that flag.
1 open issue
What changed in this PR
Addresses #36362 by keeping active node drags inside React Flow, avoiding the controlled-state update loop that can crash lineage canvases during edge auto-pan.
Changes:
- Adds a shared drag hook and integrates it into both lineage canvases, preserving in-flight positions across parent renders and committing positions on drop.
- Hides dragged nodes’ edges from rendering and hit-testing while keeping other edges visible.
- Adds regression coverage, Playwright impact mappings, and a decision record documenting drag ownership.
| File | Description |
|---|---|
openmetadata-ui/src/main/resources/ui/src/utils/EdgeMidpointUtils.ts |
Excludes dragged-node edges from midpoint markers. |
openmetadata-ui/src/main/resources/ui/src/utils/EdgeMidpointUtils.test.ts |
Tests dragged-node edge detection. |
openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.ts |
Filters dragged-node edges from canvas rendering. |
openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.test.ts |
Verifies unrelated edges remain drawn. |
openmetadata-ui/src/main/resources/ui/src/hooks/lineage/useUncontrolledNodeDrag.ts |
Keeps drag frames local and commits drop positions. |
openmetadata-ui/src/main/resources/ui/src/hooks/lineage/useUncontrolledNodeDrag.test.tsx |
Covers drag updates, overlays, cancellation, and passthrough. |
openmetadata-ui/src/main/resources/ui/src/components/Lineage/UncontrolledDragFlow/UncontrolledDragFlow.tsx |
Integrates the hook within the existing flow provider. |
openmetadata-ui/src/main/resources/ui/src/components/Lineage/UncontrolledDragFlow/UncontrolledDragFlow.test.tsx |
Exercises drag handling through the real flow store. |
openmetadata-ui/src/main/resources/ui/src/components/Lineage/LineageMap/LineageMap.component.tsx |
Applies uncontrolled dragging to the platform map. |
openmetadata-ui/src/main/resources/ui/src/components/Lineage/EntityLineageCanvas/EntityLineageCanvas.tsx |
Uses the drag-aware React Flow wrapper. |
openmetadata-ui/src/main/resources/ui/src/components/Lineage/EntityLineageCanvas/EntityLineageCanvas.test.tsx |
Adapts the canvas mock to the wrapper. |
openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.tsx |
Refreshes test markers from live flow nodes. |
openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.test.tsx |
Adds the live-node hook mock. |
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageControls.spec.ts |
Adds auto-pan, edge visibility, and drop-position regression checks. |
docs/decisions/2026-11-03-lineage-node-drags-stay-in-react-flow-until-drop.md |
Records drag ownership and edge visibility contracts. |
.github/playwright/impact-map.json |
Maps drag and edge utilities to lineage tests. |
Review effort: Balanced
|
| Count | Rule |
|---|---|
| 1 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Lineage/EntityLineageCanvas/EntityLineageCanvas.tsx:133:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'updateEntityData'. Either include it or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed… drag starts A touch drag cancelled by a second finger sends no drop. Forgetting it on the next drag left React Flow's store marking that node as dragging, so its edges stayed hidden until a parent re-sync, and its last position never reached the caller. Such a drag is now settled as a drop: its dragging flag is cleared in React Flow's store and its last position is reported once.
The redraw effect cancelled its scheduled frame on every dependency change and rescheduled it. React Flow's auto-pan moves the viewport from its own animation frame, which runs just before ours, so every frame cancelled the draw and the edge canvas froze until the drop. A scheduled frame now survives dependency changes (it reads the latest state through a ref) and is cancelled only on unmount.
Code Review ✅ Approved🟡 Medium risk · Changes lineage drag-state handling and edge rendering; incorrect position commits or edge visibility could disrupt users editing lineage graphs. Makes lineage node drags uncontrolled until the drop via a new VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
…age-release-fixes #36901 drives the lineage map's nodes through useUncontrolledNodeDrag; the canvas keeps its lineage-map-canvas wrapper around the new flow props. #35438 gave the Lineage page's settings button a translated tooltip, so the action-button memo depends on t again. The Playwright impact map is regenerated.




Describe your changes:
Fixes #36362
Dragging a lineage node and holding it at the canvas edge (so React Flow auto-pans) could crash the page with "Maximum update depth exceeded".
Both lineage canvases passed controlled nodes to React Flow v11, so every drag frame went through
onNodesChangeinto React state and back into React Flow's store. During auto-pan that happened several times per animation frame. This PR makes node drags uncontrolled until the drop, as the issue proposes:onNodesChangegets no drag frames, only the drop, with the final position filled in.<ReactFlow>.Type of change:
High-level design:
hooks/lineage/useUncontrolledNodeDrag.ts(new): wraps the caller'sonNodesChange.positionwithdragging: true) are applied to React Flow's store withstore.setNodesand remembered in a ref.nodeswith in-flight positions overlaid, so a caller re-render never hands React Flow pre-drag positions.draggingflag is cleared in React Flow's store and its last position is reported once.components/Lineage/UncontrolledDragFlow/UncontrolledDragFlow.tsx(new): a<ReactFlow>that applies the hook. It renders insideEntityLineageCanvas's existingReactFlowProvider.LineageMap.component.tsx: the platform map has the same controlled pattern and calls the hook inline, because its<ReactFlow>takes aref.useCanvasEdgeRenderer.ts,EdgeMidpointUtils.ts,CanvasEdgeRenderer.component.tsx:draggingare skipped when drawing and hit-testing, through the newisEdgeOnDraggedNodehelper.ADR:2026-11-03-lineage-node-drags-stay-in-react-flow-until-dropstates the contract. During a drag, positions live only in React Flow's store, and only the dragged node's edges are hidden.autoPanOnNodeDrag={false}removes the trigger but changes the UX.@xyflow/reactv12 is a larger migration.Tests:
Use cases covered
Unit tests
src/hooks/lineage/useUncontrolledNodeDrag.test.tsxsrc/components/Lineage/UncontrolledDragFlow/UncontrolledDragFlow.test.tsx(real React Flow store, drivesupdateNodePositions)src/utils/EdgeMidpointUtils.test.tssrc/hooks/useCanvasEdgeRenderer.test.ts(skips only a dragged node's edges; a dependency change does not cancel a scheduled draw)CanvasEdgeRenderer.component.test.tsxEntityLineageCanvas.test.tsxuseUncontrolledNodeDrag.ts: 100% lines, 93.75% branchesUncontrolledDragFlow.tsx: 100%useCanvasEdgeRenderer.ts: 85.9% lines (the uncovered lines are pre-existing code this PR doesn't touch)yarn test src/utils/EdgeMidpointUtils src/components/Lineage src/hooks/lineage src/hooks/useCanvasEdgeRenderer src/components/Entity/EntityLineage: 41 suites, 491 tests passed.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
openmetadata-ui/.../ui/playwright/for UI changes.playwright/e2e/Pages/Lineage/LineageControls.spec.ts, new "Node drag" test..github/playwright/impact-map.jsonnow maps the new hook, edge-renderer and midpoint files to the lineage specs./apiproxied to a local OpenMetadata server.1. Full impact-mapped selection (
make playwright_affected_run, 692 tests, 88 min): 657 passed, 30 failed. Every failure was traced or rerun (see notes).LineageControls(incl. "Node drag") ·LineageInteraction·PlatformLineage·LineageRightPanelLineageNodePagination·LineageLargeResponse·LineageTempTables·Flow/LineageSettingsLineageFiltersDataAssetLineageSearchRBAC·DomainIsolation(6 specs) ·Navbar·DataMarketplace·PoliciesSearchSettings·SearchRelevance·HealthCheck·DataAssetRulesEnabledDashboards·DataAssetRulesDisabledEntity.spec.tsIntakeForm·SystemCertificationTags· setup teardowns2. Reruns on HEAD
1e404343f9a(production build, freshsetup/entity-data-setup):maina20b39f)DataAssetLineage·Dashboards·DataAssetRulesDisabled(rerun in full)LineageControls·LineageInteraction·PlatformLineage·LineageFiltersLineageLargeResponse·LineageNodePagination·LineageRightPanel·LineageTempTables·LineageSettingsImpactAnalysis·ExplorePageRightPanel·InputOutputPorts·PaginationNavbar·DataMarketplace·Policies·SearchSettings·ExploreFilterSeparation3. After the review fixes, on HEAD
9e219710f05(cancelled-drag settling and the edge-canvas redraw fix):LineageControls·LineageInteraction·PlatformLineage·DataAssetLineageLineageRightPanel·LineageNodePagination·LineageTempTables·LineageLargeResponse¹ "verify downstream count for all the entities" expects
Downstream 15and fails the same way on themainbuild: re-seeding the local test data without a teardown leaves an extra edge on that root. This is local data, not this change.² During the run I swapped the local build server it was using, so these tests got
ECONNREFUSEDor an app that never booted. The oneDataAssetRulesDisabledfailure was a409 Entity already existstest-data collision.DataAssetLineage,DashboardsandDataAssetRulesDisabledall pass in full when rerun on HEAD (table 2).³ "Domain Add, Update and Remove" for each entity type, plus one glossary-term test: the domain widget never renders on the asset page. The Table domain test fails the same way on the
mainbuild, so it is environmental, not this change.Manual testing performed
yarn startagainst a local server (localhost:8585) and logged in as admin./table/sample_data.ecommerce_db.shopify.dim_customer/lineage?fullscreen=true, dragged a node to the top edge and held it. The view auto-panned, there was no crash, only that node's edges hid, and they came back on the drop with the node where it was dropped.UI screen recording:
Recorded on commit
9e219710f05(1440×900, 18 s, H.264).lineage-drag-autopan-fix.mp4
yarn build) of9e219710f05, served with/apiproxied to a local OpenMetadata server running in Docker (collate_server, healthy;GET /api/v1/system/version→2.0.0-SNAPSHOT). The change is UI-only, so the server image does not carry it.sample_data.ecommerce_db.shopifyschema: tablesorders_raw_*→orders_daily_*andorders_raw_*→orders_audit_*. Deleted after the recording.orders_raw_*lineage (full screen); dragorders_daily_*to the top edge and hold it there for about 4.5 s; drag it back into the canvas and drop it.orders_audit_*edge keeps drawing and moves with the canvas;Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: not applicable (no schema change).
For a UI feature or feature task: not applicable (bug fix; see above).
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.68d1cf08e87and found no 🔴.1e404343f9a).fdec4b48e2f, which settles such a drag where it was left; the test seeds the store and asserts the flag is cleared while the next node is still dragging.9e219710f05, with a regression test.LineageMaphas no drag Playwright test: its scene nodes have no stable test ids. Its drag path goes through the same hook, which is covered by the hook and wrapper unit tests.Decision check: adds
docs/decisions/2026-11-03-lineage-node-drags-stay-in-react-flow-until-drop.md.I have added a test that covers the exact scenario we are fixing (
LineageControls.spec.ts› "Node drag", Lineage: node drag held at the canvas edge can crash with 'Maximum update depth exceeded' (make drag uncontrolled) #36362).