Skip to content

Added lazy loading for enum select field in the advanced search#29736

Merged
Rohit0301 merged 8 commits into
mainfrom
enum-lazyload
Jul 7, 2026
Merged

Added lazy loading for enum select field in the advanced search#29736
Rohit0301 merged 8 commits into
mainfrom
enum-lazyload

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Screen.Recording.2026-07-06.at.12.57.53.PM.mov
Screenshot 2026-07-06 at 12 57 34 PM

Fixes 4818

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

UI screen recording / screenshots:

Not applicable.

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: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Summary by Gitar

  • New Component:
    • Added EnumAsyncSelectWidget to support lazy-loading and pagination for enum fields in advanced search.
  • Refactor:
    • Updated AdvancedSearchClassBase to use EnumAsyncSelectWidget for enum custom properties, replacing static listValues with an async fetch implementation.
  • Testing:
    • Added Playwright E2E test verifying lazy loading on scroll for enum fields.
    • Added unit tests for buildEnumAsyncFetch and updated existing search configuration tests.

This will update automatically on new commits.

Greptile Summary

This PR adds lazy-loading pagination for enum custom property fields in the advanced search filter, replacing the static listValues approach with an asyncFetch function that returns 100 values per page with optional text-based filtering.

  • buildEnumAsyncFetch is introduced on AdvancedSearchClassBase as a closure over the enum values array; it filters by search query and slices by offset, returning a hasMore flag to drive the "Load more" UI affordance.
  • The case 'enum' branch in getCustomPropertiesSubFields now sets asyncFetch, useAsyncSearch: true, and useLoadMore: true instead of calling getCustomPropertyAdvanceSearchEnumOptions.
  • Unit tests for buildEnumAsyncFetch cover pagination, filtering, and edge cases; a new Playwright suite verifies the "Load more" button and search-through-all-values behaviour end-to-end.

Confidence Score: 4/5

Mostly safe to merge; the unsafe property access on config.values when customPropertyConfig is absent can crash the advanced-search panel for any enum field missing its config object.

The core lazy-loading logic in buildEnumAsyncFetch is clean and well-tested. The one defect flagged in a previous review thread remains unaddressed: (field.customPropertyConfig?.config as CustomPropertyEnumConfig).values throws a TypeError before the ?? [] fallback can fire when customPropertyConfig is absent, which would crash the advanced-search panel for any enum property whose config has not been populated.

AdvancedSearchClassBase.ts — specifically the case 'enum' block at the enumValues assignment.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts Adds buildEnumAsyncFetch and switches the enum custom property case to asyncFetch/useLoadMore; contains an unsafe property access on config.values that will throw when customPropertyConfig is absent.
openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.test.ts Updated enum-related tests to assert asyncFetch/useLoadMore instead of listValues; adds comprehensive buildEnumAsyncFetch unit tests covering pagination, filtering, and edge cases.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts Adds two E2E tests for enum lazy loading; enumCPId is captured but never referenced again, and the test block has no afterAll to clean up either the created table or the enum custom property.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[getCustomPropertiesSubFields\ncalled for enum field] --> B{customPropertyConfig\nexists?}
    B -- yes --> C[Access .config.values]
    B -- no --> X[TypeError thrown\nfallback unreachable]
    C --> D[buildEnumAsyncFetch\nwraps values in closure]
    D --> E[Field registered with\nasyncFetch and useLoadMore]
    E --> G[User opens dropdown]
    G --> H[asyncFetch called\nsearch empty, offset 0]
    H --> I{Search query\npresent?}
    I -- yes --> J[Filter by\ncase-insensitive substring]
    I -- no --> K[Use full values array]
    J --> L[Slice offset to offset+100]
    K --> L
    L --> M[Return page and hasMore]
    M --> N{hasMore true?}
    N -- yes --> O[Show Load more button]
    N -- no --> P[End of list]
    O --> Q[User clicks Load more\noffset increments by 100]
    Q --> H
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[getCustomPropertiesSubFields\ncalled for enum field] --> B{customPropertyConfig\nexists?}
    B -- yes --> C[Access .config.values]
    B -- no --> X[TypeError thrown\nfallback unreachable]
    C --> D[buildEnumAsyncFetch\nwraps values in closure]
    D --> E[Field registered with\nasyncFetch and useLoadMore]
    E --> G[User opens dropdown]
    G --> H[asyncFetch called\nsearch empty, offset 0]
    H --> I{Search query\npresent?}
    I -- yes --> J[Filter by\ncase-insensitive substring]
    I -- no --> K[Use full values array]
    J --> L[Slice offset to offset+100]
    K --> L
    L --> M[Return page and hasMore]
    M --> N{hasMore true?}
    N -- yes --> O[Show Load more button]
    N -- no --> P[End of list]
    O --> Q[User clicks Load more\noffset increments by 100]
    Q --> H
Loading

Reviews (7): Last reviewed commit: "Merge branch 'main' into enum-lazyload" | Re-trigger Greptile

@Rohit0301 Rohit0301 self-assigned this Jul 3, 2026
@Rohit0301 Rohit0301 requested a review from a team as a code owner July 3, 2026 13:16
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

Comment thread openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts Outdated
Comment on lines +1631 to +1647
await lazyLoadTable.delete(apiContext);
} finally {
await afterAction();
}
}
);

test(
'should lazy-load enum options on scroll in the advanced filter value dropdown',
async ({ page }) => {
test.slow();

await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.EXPLORE);
await showAdvancedSearchDialog(page);

const ruleLocator = page.locator('.rule').nth(0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Custom property not deleted in afterAll cleanup

The afterAll hook deletes lazyLoadTable but never removes the enumCPName custom property that was registered on the table metadata type in beforeAll. Every CI run will therefore accumulate orphaned enum-lazy-{uuid} custom properties on the system-wide table type, which could affect other tests that enumerate custom properties or render the advanced-search field list.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (25 flaky)

✅ 4512 passed · ❌ 0 failed · 🟡 25 flaky · ⏭️ 55 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 418 0 7 33
🟡 Shard 2 815 0 8 4
✅ Shard 3 816 0 0 12
🟡 Shard 4 818 0 3 5
🟡 Shard 5 829 0 2 0
🟡 Shard 6 816 0 5 1
🟡 25 flaky test(s) (passed on retry)
  • Features/Glossary/GlossaryPagination.spec.ts › should filter by InReview status (shard 1, 1 retry)
  • Features/MutuallyExclusiveColumnTags.spec.ts › Should show error toast when adding mutually exclusive tags to column (shard 1, 1 retry)
  • Features/NavigationBlocker.spec.ts › should stay on current page and keep changes when X button is clicked (shard 1, 1 retry)
  • Pages/AuditLogs.spec.ts › should create audit log entry when glossary is created (shard 1, 1 retry)
  • Pages/DescriptionVisibility.spec.ts › Customized Table detail page Description widget shows long description (shard 1, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: mlmodel (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › a dashboard-scoped user sees dashboards but never tables (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary Term (Nested) (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Database service (shard 2, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article listing search filters, clears, and shows empty state (shard 2, 2 retries)
  • Features/ContextCenterArticles.spec.ts › Article list cards, recently viewed widget, and pagination work (shard 2, 1 retry)
  • Features/ContextCenterDocumentPage.spec.ts › uploaded document card shows name, size, updatedBy, updatedAt, and folder (shard 2, 1 retry)
  • Features/ContextCenterDocumentPage.spec.ts › bulk delete 2 documents removes them from the list and both appear in the archive (shard 2, 1 retry)
  • Features/ContextCenterMemories.spec.ts › clicking a memory row adds ?memory= param to the URL (shard 2, 1 retry)
  • Features/ContextCenterPermission.spec.ts › user with editAll permission can see restore action but not delete action on an archived document, and can restore it (shard 2, 1 retry)
  • Flow/ApiServiceRest.spec.ts › add update and delete api service type REST (shard 4, 1 retry)
  • Flow/ServiceForm.spec.ts › should persist empty schemaRegistryTopicSuffixName when the field is cleared (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Should display custom properties for apiCollection in right panel (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Delete Metric (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should allow Data Steward to edit glossary terms for dashboardDataModel (shard 6, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should allow Data Steward to view all tabs for searchIndex (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 6, 1 retry)
  • Pages/TagPageRightPanel.spec.ts › Should open right panel when clicking asset in tag assets page (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

…lter

Replaces the static listValues render with asyncFetch + useLoadMore for
enum custom properties. Opens the dropdown instantly with the first 100
options, adds a "Load more..." button for pagination, and supports
searching across all values without clicking Load more.

Adds Playwright tests covering the Load more button flow (click → scroll
→ page-2 item visible) and the search-across-pages flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

Reviewing your code

Code Review ⚠️ Changes requested 4 resolved / 5 findings

Introduces lazy-loaded, paginated enum select fields for advanced search, but fails to clean up custom properties in the E2E test suite and lacks proper debounce cleanup in the new widget.

⚠️ Quality: afterAll cleanup removed: leaks table and system-wide enum custom property

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1580 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1621-1622 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1628-1642

This commit deleted the entire test.afterAll('Cleanup enum custom property and table', ...) block that previously called lazyLoadTable.delete(apiContext), replacing it with the openEnumValueDropdown helper. As a result the describe block now has NO teardown at all: neither the lazyLoadTable entity nor the enum custom property is deleted.

The custom property (enumCPName) is registered on the system-wide table metadata type via PUT /api/v1/metadata/types/{id}, so every CI run permanently accumulates an orphaned enum-lazy-<uuid> property on the shared type, which can bloat/interfere with the test environment and other Explore/custom-property tests. The table entity is also leaked now that its delete call was dropped.

Note that enumCPId is captured from the PUT response (line 1621-1622) but never used — this strongly indicates a delete-by-id in afterAll was intended but omitted, and the unused variable will also trip the no-unused-vars ESLint CI check.

Restore an afterAll that deletes both the table and the custom property.

Re-add teardown deleting the table and removing the custom property (adjust to the actual metadata-type custom-property delete API; enumCPId can be used if a delete-by-id endpoint exists).
test.afterAll(
  'Cleanup enum custom property and table',
  async ({ browser }) => {
    const { apiContext, afterAction } = await performAdminLogin(browser);
    try {
      await lazyLoadTable.delete(apiContext);
      const cpMetadataTypeRes = await apiContext.get(
        '/api/v1/metadata/types/name/table?fields=customProperties'
      );
      const cpMetadataType = await cpMetadataTypeRes.json();
      await apiContext.patch(
        `/api/v1/metadata/types/${cpMetadataType.id}`,
        { data: [{ op: 'remove', path: `/customProperties/${enumCPName}` }] }
      );
    } finally {
      await afterAction();
    }
  }
);
✅ 4 resolved
Quality: New factory uses any types, violates no-any CI rule

📄 openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts:114-128
The newly added multiselect.factory is declared as factory: (props: any, ctx: any) => {...}. The project's CI constraints prohibit the any type, so this will likely fail lint/CI. This factory is entirely new code in this PR (not a pre-existing pattern). Type the parameters with the appropriate types from @react-awesome-query-builder (e.g. the widget factory props/context types) or, if the library types are inadequate, define a minimal local interface capturing the fields actually used (useScrollLoad, asyncFetch, readonly, placeholder, setValue, value, showSearch, plus RCE/W on the context).

Edge Case: loadOptions has no error handling; rejections swallowed

📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:49-63 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:72-74 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:76-82
loadOptions awaits asyncFetch inside a try/finally with no catch, and its callers (useEffect, debounced onSearch, onPopupScroll) invoke it without catching the returned promise. If asyncFetch ever rejects (the widget's typed contract allows any async source, not just the current in-memory enum fetch), the error becomes an unhandled promise rejection and the dropdown silently keeps stale/empty options with no user feedback. Add a catch that clears/handles the error state (and optionally resets options on offset 0).

Quality: New component uses Ant Design Select instead of core components

📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:14 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:96-110
Per the frontend guidelines, new code should avoid Ant Design and prioritize openmetadata-ui-core-components with the tw: (Tailwind) prefix. This new widget imports Select from antd. While the surrounding query-builder config is Antd-based (AntdConfig), consider whether a core-component equivalent is feasible, or document why Antd is required here for rendering compatibility within the query builder.

Bug: Pending debounce/in-flight load can setState after unmount

📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:76-82 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:49-63
The debounced onSearch is never cancelled on unmount, and an in-flight loadOptions will call setOptions/setLoading/setHasMore after resolution. If the query-builder rule (and thus this widget) unmounts while a debounced search is pending or a fetch is in flight, React will attempt a state update on an unmounted component. Cancel the debounced function in a cleanup effect (and/or guard state updates with a mounted ref).

🤖 Prompt for agents
Code Review: Introduces lazy-loaded, paginated enum select fields for advanced search, but fails to clean up custom properties in the E2E test suite and lacks proper debounce cleanup in the new widget.

1. ⚠️ Quality: afterAll cleanup removed: leaks table and system-wide enum custom property
   Files: openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1580, openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1621-1622, openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1628-1642

   This commit deleted the entire `test.afterAll('Cleanup enum custom property and table', ...)` block that previously called `lazyLoadTable.delete(apiContext)`, replacing it with the `openEnumValueDropdown` helper. As a result the describe block now has NO teardown at all: neither the `lazyLoadTable` entity nor the enum custom property is deleted.
   
   The custom property (`enumCPName`) is registered on the system-wide `table` metadata type via `PUT /api/v1/metadata/types/{id}`, so every CI run permanently accumulates an orphaned `enum-lazy-<uuid>` property on the shared type, which can bloat/interfere with the test environment and other Explore/custom-property tests. The table entity is also leaked now that its delete call was dropped.
   
   Note that `enumCPId` is captured from the PUT response (line 1621-1622) but never used — this strongly indicates a delete-by-id in `afterAll` was intended but omitted, and the unused variable will also trip the no-unused-vars ESLint CI check.
   
   Restore an `afterAll` that deletes both the table and the custom property.

   Fix (Re-add teardown deleting the table and removing the custom property (adjust to the actual metadata-type custom-property delete API; enumCPId can be used if a delete-by-id endpoint exists).):
   test.afterAll(
     'Cleanup enum custom property and table',
     async ({ browser }) => {
       const { apiContext, afterAction } = await performAdminLogin(browser);
       try {
         await lazyLoadTable.delete(apiContext);
         const cpMetadataTypeRes = await apiContext.get(
           '/api/v1/metadata/types/name/table?fields=customProperties'
         );
         const cpMetadataType = await cpMetadataTypeRes.json();
         await apiContext.patch(
           `/api/v1/metadata/types/${cpMetadataType.id}`,
           { data: [{ op: 'remove', path: `/customProperties/${enumCPName}` }] }
         );
       } finally {
         await afterAction();
       }
     }
   );

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.78% (72768/114089) 46.92% (42353/90258) 48.21% (13030/27024)

karanh37
karanh37 previously approved these changes Jul 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@Rohit0301 Rohit0301 merged commit 91b2106 into main Jul 7, 2026
51 of 53 checks passed
@Rohit0301 Rohit0301 deleted the enum-lazyload branch July 7, 2026 05:09
@gitar-bot

gitar-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 5 resolved / 5 findings

Introduces lazy-loaded, paginated enum select fields for advanced search, but fails to clean up custom properties in the E2E test suite and lacks proper debounce cleanup in the new widget.

✅ 5 resolved
Quality: New factory uses any types, violates no-any CI rule

📄 openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts:114-128
The newly added multiselect.factory is declared as factory: (props: any, ctx: any) => {...}. The project's CI constraints prohibit the any type, so this will likely fail lint/CI. This factory is entirely new code in this PR (not a pre-existing pattern). Type the parameters with the appropriate types from @react-awesome-query-builder (e.g. the widget factory props/context types) or, if the library types are inadequate, define a minimal local interface capturing the fields actually used (useScrollLoad, asyncFetch, readonly, placeholder, setValue, value, showSearch, plus RCE/W on the context).

Edge Case: loadOptions has no error handling; rejections swallowed

📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:49-63 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:72-74 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:76-82
loadOptions awaits asyncFetch inside a try/finally with no catch, and its callers (useEffect, debounced onSearch, onPopupScroll) invoke it without catching the returned promise. If asyncFetch ever rejects (the widget's typed contract allows any async source, not just the current in-memory enum fetch), the error becomes an unhandled promise rejection and the dropdown silently keeps stale/empty options with no user feedback. Add a catch that clears/handles the error state (and optionally resets options on offset 0).

Quality: New component uses Ant Design Select instead of core components

📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:14 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:96-110
Per the frontend guidelines, new code should avoid Ant Design and prioritize openmetadata-ui-core-components with the tw: (Tailwind) prefix. This new widget imports Select from antd. While the surrounding query-builder config is Antd-based (AntdConfig), consider whether a core-component equivalent is feasible, or document why Antd is required here for rendering compatibility within the query builder.

Bug: Pending debounce/in-flight load can setState after unmount

📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:76-82 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/EnumAsyncSelectWidget/EnumAsyncSelectWidget.component.tsx:49-63
The debounced onSearch is never cancelled on unmount, and an in-flight loadOptions will call setOptions/setLoading/setHasMore after resolution. If the query-builder rule (and thus this widget) unmounts while a debounced search is pending or a fetch is in flight, React will attempt a state update on an unmounted component. Cancel the debounced function in a cleanup effect (and/or guard state updates with a mounted ref).

Quality: afterAll cleanup removed: leaks table and system-wide enum custom property

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1580 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1621-1622 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1628-1642
This commit deleted the entire test.afterAll('Cleanup enum custom property and table', ...) block that previously called lazyLoadTable.delete(apiContext), replacing it with the openEnumValueDropdown helper. As a result the describe block now has NO teardown at all: neither the lazyLoadTable entity nor the enum custom property is deleted.

The custom property (enumCPName) is registered on the system-wide table metadata type via PUT /api/v1/metadata/types/{id}, so every CI run permanently accumulates an orphaned enum-lazy-<uuid> property on the shared type, which can bloat/interfere with the test environment and other Explore/custom-property tests. The table entity is also leaked now that its delete call was dropped.

Note that enumCPId is captured from the PUT response (line 1621-1622) but never used — this strongly indicates a delete-by-id in afterAll was intended but omitted, and the unused variable will also trip the no-unused-vars ESLint CI check.

Restore an afterAll that deletes both the table and the custom property.

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Rohit0301 added a commit that referenced this pull request Jul 7, 2026
* Added lazy loading for enum select field in the advanced search

* fix(ui): lazy load enum custom property options in advanced search filter

Replaces the static listValues render with asyncFetch + useLoadMore for
enum custom properties. Opens the dropdown instantly with the first 100
options, adds a "Load more..." button for pagination, and supports
searching across all values without clicking Load more.

Adds Playwright tests covering the Load more button flow (click → scroll
→ page-2 item visible) and the search-across-pages flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* lint fix

* fixed unit test

* fix test

* lint fix

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants