Skip to content

Fixes #36119: Block editor mention popup crashes on updateProps - #36103

Merged
Rohit0301 merged 7 commits into
mainfrom
Rohit0301/typeerror-search-counts-fix
Oct 23, 2026
Merged

Rohit0301 merged 7 commits into
mainfrom
Rohit0301/typeerror-search-counts-fix

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #36119

Root cause: @tiptap/suggestion (2.27.3, src/suggestion.ts:272-296) waits for the async items() search before it calls onStart/onUpdate. Typing @ starts a user/team search. If the next keystroke's search comes back first, onUpdate runs before onStart has created the ReactRenderer, and component.updateProps throws. hashtagSuggestion has a second path: its onStart returns early on a read-only editor, so every onUpdate throws.

Fix: in all three suggestion renderers (mention, hashtag, slash-command), an onUpdate that arrives before onStart no longer touches the missing component. It saves its props, and onStart renders 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:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • onUpdate arrives before onStart (mention, hashtag, slash command) → no throw, and the popup renders with the newer props
  • Hashtag onStart on a read-only editor, then onUpdate → no throw

Unit tests

  • I added unit tests for the new/changed logic.
  • Files updated: mentionSuggestions.test.ts, hashtagSuggestion.test.ts, renderItems.test.ts
  • Without the fix: 4 failed, 23 passed. With the fix: 27/27 pass.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable. The bug is a network race that can't be reproduced deterministically in E2E; the unit tests cover the exact callback order.

Manual testing performed

  • None.

UI screen recording:

Not applicable: standalone crash fix, no visible UI change.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code


Summary by Gitar

  • Bug fix:
    • Guarded onUpdate in mention, hashtag, and slash-command renderers when onStart has not rendered yet
  • Pending props:
    • Hashtag suggestion stores early onUpdate props and renders the newest ones on onStart
  • UI styling:
    • Adjusted persona name and identifier typography in ContextCenterAIContextPage

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable new issues were established.

Summary

The PR buffers suggestion updates that arrive before ReactRenderer exists.

  • Suggestion popups keep the latest query when searches finish out of order.
  • Persona names use medium weight and smaller secondary text in the AI Context table.
  • The Playwright impact map now links updated profile sources to their page tests.

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

@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).
@Rohit0301
Rohit0301 requested a review from a team as a code owner October 23, 2026 12:11
@Rohit0301
Rohit0301 requested a review from sweta1308 October 23, 2026 12:11
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added the UI UI specific issues label Oct 23, 2026
@Rohit0301 Rohit0301 self-assigned this Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Oct 23, 2026
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.
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 79%
79.65% (130569/163922) 66.18% (46035/69553) 69.07% (26100/37786)

@Rohit0301
Rohit0301 enabled auto-merge October 23, 2026 13:02
@Rohit0301 Rohit0301 changed the title fix(ui): guard suggestion onUpdate when onStart has not rendered Fixes #36119: Block editor mention popup crashes on updateProps Oct 23, 2026
@Rohit0301
Rohit0301 added this pull request to the merge queue Oct 23, 2026
@Rohit0301
Rohit0301 removed this pull request from the merge queue due to a manual request Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-10-23T15:44:17Z)

The entry left the queue before it was built, so no checks ran against it.

…earch-counts-fix

# Conflicts:
#	openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterAIContextPage/ContextCenterAIContextPage.tsx
@Rohit0301
Rohit0301 enabled auto-merge October 23, 2026 15:45
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 983 → 992
- 13 added, 4 removed, 27 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyCard/CustomPropertyHeader.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskDetailPage.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/components/ChangePasswordRow.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/components/RolesRow.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/customProperties/CustomPropertyRow.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/customProperties/UserCustomPropertiesSection.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/members/MembersUserDetail.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/members/MembersUserDetailBanners.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/members/useMembersUserDetailHeader.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/UserAssets/UserAssetCard.tsx
  … and 3 more

Removed source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyCard/CustomPropertyCardList.tsx
  openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyCard/CustomPropertyVersionList.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/MyData/components/MyDataAssetsList.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/components/UserAdminRow.tsx

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/e2e/Utils/appMode.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/entity/TableClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/fixtures/isolatedUser.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/user/UserClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/activityAPI.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/aiProfile.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/apiResponse.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/customProperty.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/inbox.ts
  … and 17 more

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 getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

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

@gitar-bot

gitar-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown
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 onUpdate handlers in the mention, hashtag, and slash-command renderers so an early update no longer throws when onStart has not rendered yet, and hashtag suggestions now keep the newest pending props for the late render. The previously open finding about late onStart renders showing stale suggestions is resolved. No open issues found.

✅ 1 closed
✅ Edge Case: Late onStart renders stale suggestions after an early onUpdate is dropped

📄 openmetadata-ui/src/main/resources/ui/src/components/BlockEditor/Extensions/hashtag/hashtagSuggestion.ts:55-69 📄 openmetadata-ui/src/main/resources/ui/src/components/BlockEditor/Extensions/mention/mentionSuggestions.ts 📄 openmetadata-ui/src/main/resources/ui/src/components/BlockEditor/Extensions/slash-command/renderItems.ts
When the later query's search returns first, onUpdate now does nothing because component is undefined. The earlier onStart then arrives and builds the ReactRenderer from its own older props: the items and range for the shorter query, such as plain @. If the user stops typing, the popup keeps showing results that don't match the typed query, and Enter or a click runs command with the stale range and item. Nothing refreshes the list until another keystroke. The PR description admits this ('the next keystroke updates them'), but the extra keystroke may never come.

Fix: in onUpdate, save the props when component is not set yet, and have onStart use those saved props if they exist. Apply this to the mention, hashtag and slash-command renderers.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 1 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 1 warning(s) across 1 changed file(s).

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

@Rohit0301
Rohit0301 added this pull request to the merge queue Oct 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 23, 2026
@github-actions github-actions Bot added the queue conflict Conflicted only with an entry ahead in the merge queue label Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — merge_conflict (2026-10-23T16:29:42Z)

The entry left the queue before it was built, so no checks ran against it.

Applies cleanly to the latest main; it conflicted only with an entry ahead in the queue. Re-queue once that entry has merged or left the queue.

@Rohit0301
Rohit0301 added this pull request to the merge queue Oct 23, 2026
@github-actions github-actions Bot removed the queue conflict Conflicted only with an entry ahead in the merge queue label Oct 23, 2026
Merged via the queue into main with commit 0601b9a Oct 23, 2026
92 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/typeerror-search-counts-fix branch October 23, 2026 18:48
Rohit0301 added a commit that referenced this pull request Nov 5, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block editor mention popup crashes: Cannot read properties of undefined (reading 'updateProps')

2 participants