chore(UI): upgrade react-router-dom v6 → v7 and fix column panel race condition - #30580
chore(UI): upgrade react-router-dom v6 → v7 and fix column panel race condition#30580Rohit0301 wants to merge 3 commits into
Conversation
… condition - Bump react-router-dom from 6.30.4 to 7.18.1 - In v7, navigate() is wrapped in React.startTransition, deferring the router re-render. This caused the column detail panel to reopen after close because effects still saw stale URL params during the transition. - Fix useFqnDeepLink.ts: move selectedColumn to a ref so it is read without triggering the effect when closeColumnDetailPanel sets it null. - Fix GenericProvider.tsx: add skipNextColumnSync ref that is set before navigate() in closeColumnDetailPanel and consumed once in the URL-sync useEffect, preventing the panel from reopening during the deferred re-render window. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
🔴 Playwright Results — workflow failedValidated commit ✅ 426 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 5 skipped · 🧰 0 lifecycle flaky Pipeline and setup failures (3)
PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 58m 36s ⏱️ Max setup 2m 51s · max shard execution 21m 0s · max shard-job elapsed before upload 24m 21s · reporting 5s 🌐 254.62 requests/attempt · 2.86 app boots/UI scenario · 43.25% common-shard skew Optimization targets still in progress:
🟡 1 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review ✅ Approved 2 resolved / 2 findingsUpgrades React Router DOM to v7 and resolves column detail panel race conditions using non-reactive refs and a one-shot synchronization guard. No issues found. ✅ 2 resolved✅ Bug: useFqnDeepLink still re-fires on close via openColumnDetailPanel dep
✅ Edge Case: skipNextColumnSync one-shot flag can be consumed by unrelated re-run
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
|



Describe your changes:
675
I upgraded
react-router-domfrom6.30.4to7.18.1and fixed a race condition that the upgrade exposed: in v7,navigate()is wrapped inReact.startTransition, which defers the router re-render. This caused the column detail panel to briefly reopen after closing because effects still saw stale URL params during the transition window.package.json/yarn.lock: bumpreact-router-domto7.18.1useFqnDeepLink.ts(primary fix): moveselectedColumnto auseRefso it is read without being a reactive dependency — prevents the hook re-firing whencloseColumnDetailPanelsets it tonullwhilecolumnPartis still staleGenericProvider.tsx(defensive guard): add askipNextColumnSyncref that is set totrueinsidecloseColumnDetailPanelbeforenavigate(), and consumed once in the URL-syncuseEffect, blocking the panel from reopening during the deferred re-render windowSettingsSso.tsxwas audited and its existingconfigFetchedref guard is sufficient — no code change needed there.Type of change:
High-level design:
react-router v7 wraps every
navigate()/setSearchParams()call inReact.startTransition, so the router's React state (useParams,useSearchParams) is updated asynchronously. Local React state (setSelectedColumn(null)) updates synchronously. AnyuseEffectthat depends on both will fire immediately with a mix of new local state and stale URL params — creating a reopen race.The two fixes use the "ref as a non-reactive value" pattern: store the value in a ref so it can be read inside an effect without being a trigger for it. The
skipNextColumnSyncflag is a one-shot guard: set before navigate, consumed once on the next effect run, then reset — so deep-link opens on initial mount and subsequent URL-driven opens are unaffected.Tests:
Use cases covered
Unit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Table.spec.tsPlaywright tests cover the column detail panel close behavior ("Copy column link should have valid URL format"asserts.column-detail-panelis not visible after close)Manual testing performed
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Greptile Summary
The PR upgrades the UI router and adjusts column-detail synchronization to accommodate deferred navigation.
react-router-domat 7.18.1 and updates its transitive lockfile entries.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains within the scope of the eligible follow-up findings.
Important Files Changed
react-router-domto version 7.18.1.Sequence Diagram
Reviews (3): Last reviewed commit: "Merge branch 'main' into upgrade-react-r..." | Re-trigger Greptile