Repository navigation
Fixes #36119: Block editor mention popup crashes on updateProps - #36103
Conversation
@tiptap/suggestion awaits the async items() search before calling onStart or onUpdate, so a later, faster mention/hashtag search can deliver onUpdate before onStart creates the ReactRenderer. Hashtag also skips onStart on read-only editors. Both crashed with "Cannot read properties of undefined (reading 'updateProps')" (Sentry 7791931166).
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
|
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! |
Keep the props from an onUpdate that arrives before onStart and render with them, so the popup does not show the older query's items and range.
🚦 Removed from the merge queue —
|
…earch-counts-fix # Conflicts: # openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterAIContextPage/ContextCenterAIContextPage.tsx
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · The suggestion renderers now buffer early updates; lifecycle mistakes could show stale results or use an outdated insertion range. Guards suggestion ✅ 1 closed✅ Edge Case: Late onStart renders stale suggestions after an early onUpdate is dropped
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 |
|
|
| Count | Rule |
|---|---|
| 1 | openmetadata-imports/no-circular-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/BlockEditor/Extensions/slash-command/renderItems.ts:18:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
🚦 Removed from the merge queue —
|
…ocking (backport #36103 #36950) (#37130) * Fixes #36119: Block editor mention popup crashes on updateProps (#36103) * fix(ui): guard suggestion onUpdate when onStart has not rendered @tiptap/suggestion awaits the async items() search before calling onStart or onUpdate, so a later, faster mention/hashtag search can deliver onUpdate before onStart creates the ReactRenderer. Hashtag also skips onStart on read-only editors. Both crashed with "Cannot read properties of undefined (reading 'updateProps')" (Sentry 7791931166). * fix(ui): render the newest suggestion props when onUpdate beats onStart Keep the props from an onUpdate that arrives before onStart and render with them, so the popup does not show the older query's items and range. * minor ui fix * lint fix * fix(ui): use Typography color prop on AI context persona row * chore(playwright): auto-refresh impact-map.generated.json --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit 0601b9a) * Fix main-thread blocking on table pages: defer description-cell editors and stop height re-render loop (#36950) * Fix main-thread blocking on table column pages Column tables built a TipTap editor for every description cell up front (~50 per page), and each editor's staggered fill-in grew the table, re-reporting fractional widget heights that re-rendered the whole tab. - Defer description-cell editors until near the viewport (DeferredWidget), with a plain-text placeholder - Round reported widget heights to whole pixels; skip layout updates when the height is unchanged - Stabilize onTableUpdate / handleTagSelection and TableDescription memo deps * Add missing t dependency to TableDescription memo * Fix Sonar issues in SchemaTable: mark fire-and-forget promises with void, replace deprecated Select props (cherry picked from commit 2b245c9) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>



Describe your changes:
Fixes #36119
Root cause:
@tiptap/suggestion(2.27.3,src/suggestion.ts:272-296) waits for the asyncitems()search before it callsonStart/onUpdate. Typing@starts a user/team search. If the next keystroke's search comes back first,onUpdateruns beforeonStarthas created theReactRenderer, andcomponent.updatePropsthrows.hashtagSuggestionhas a second path: itsonStartreturns early on a read-only editor, so everyonUpdatethrows.Fix: in all three suggestion renderers (
mention,hashtag,slash-command), anonUpdatethat arrives beforeonStartno longer touches the missing component. It saves its props, andonStartrenders with those newer props instead of its own older ones, so the popup shows results and inserts at the range for what the user actually typed.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
onUpdatearrives beforeonStart(mention, hashtag, slash command) → no throw, and the popup renders with the newer propsonStarton a read-only editor, thenonUpdate→ no throwUnit tests
mentionSuggestions.test.ts,hashtagSuggestion.test.ts,renderItems.test.tsBackend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
UI screen recording:
Not applicable: standalone crash fix, no visible UI change.
Checklist:
🤖 Generated with Claude Code
Summary by Gitar
onUpdatein mention, hashtag, and slash-command renderers whenonStarthas not rendered yetonUpdateprops and renders the newest ones ononStartContextCenterAIContextPageThis will update automatically on new commits.


Confidence Score: 5/5
The PR appears safe to merge; no actionable new issues were established.Summary
The PR buffers suggestion updates that arrive before
ReactRendererexists.No actionable new issues were established. Tests and visual checks were not run; dependencies and built UI assets were unavailable. The merge bases differed, so the full PR diff was reviewed as the changes since the last review.
Reviews (6) · Last reviewed commit: "chore(playwright): auto-refresh impact-m..." · Reviewed by Greptile