You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(inbox): raise "Load more" scan cap past loaded backlog in one click - #35117
Context: TasksTab renders the personal/entity inbox's task list with an IntersectionObserver-driven infinite scroll gated by a client-side "bounded scan" cap (MAX_NARROWED_SCAN = 200) applied whenever the list is narrowed by Type filter, Status filter, or title-search; a "Load more" button in the no-match empty state is supposed to let the user raise that cap and continue scanning.
Bug: The cap raise in handleScanFurther advances scanLimit by a fixed MAX_NARROWED_SCAN step, but canLoadMore compares that cap against the total already-loaded task count (tasks.length), not against the number of tasks loaded since the narrowing was applied; so when more than MAX_NARROWED_SCAN raw tasks were already loaded before narrowing, the raise is smaller than the load and canLoadMore stays false, so the IntersectionObserver in useInboxInfiniteList never calls fetchNextPage.
Actual vs. expected: Clicking the "Load more" button should trigger one extra page fetch on the first click; instead it is silent — multiple consecutive clicks produce no fetch, no UI change, and no visible feedback, until the accumulated cap finally overtakes tasks.length.
Impact: When a user has already loaded ≥ 400 raw tasks (≥ 16 pages of TASK_LIMIT = 25) before narrowing — e.g. scrolling a long Open queue and then picking a Type/Status filter whose matches are none of the loaded rows — the "Load more" button is dead for floor((tasks.length - 200) / 200) clicks before the next page loads: 1 dead click at 400 loaded, 4 at 1000, 24 at 5000. Below 400 loaded the buggy and fixed code paths are behaviourally indistinguishable.
constscanKey=JSON.stringify([status,searchQuery,typeFilter,statusFilter,]);const[scanRaise,setScanRaise]=useState({key: scanKey,extra: 0});constscanLimit=MAX_NARROWED_SCAN+(scanRaise.key===scanKey ? scanRaise.extra : 0);constcanLoadMore=useCallback((loaded: Task[])=>!isClientNarrowed||loaded.length<scanLimit,// <-- BUG 🔴 cap is compared against ALL loaded raw tasks, not the count scanned under this narrow[isClientNarrowed,scanLimit]);consthandleScanFurther=useCallback(()=>setScanRaise((raise)=>({key: scanKey,// <-- BUG 🔴 raise is fixed +MAX step regardless of how far loaded.length already exceeds itextra: (raise.key===scanKey ? raise.extra : 0)+MAX_NARROWED_SCAN,})),[scanKey]);
Also in TasksTab.tsx (empty state wiring):
emptyState={showEmptyState ? (<TasksEmptyStateisNarrowed={isNarrowed}scannedCount={hasMore ? tasks.length : undefined}status={status}onClearFilters={handleClearFilters}onLoadMore={handleScanFurther}// <-- BUG 🔴 dead clicks when tasks.length > MAX_NARROWED_SCAN at narrow time/>) : undefined}
Explanation
useInboxInfiniteList only calls fetchNextPage() when canLoadMore(items) !== false. With a narrowed list, canLoadMore returns loaded.length < scanLimit.
If the user scrolls first (e.g., tasks.length = 1000) and then applies a Type/Status filter that yields zero matches among already-loaded tasks, scanLimit starts at 200 and canLoadMore is false.
Each "Load more" click only increases scanLimit by 200, so canLoadMore remains false until scanLimit exceeds the entire already-loaded backlog (e.g., 5 clicks to pass 1000). While canLoadMore is false, the IntersectionObserver-triggered loadMore no-ops and no network request is sent.
The UI provides no loading/disabled feedback for the dead clicks, so the button appears broken.
Codebase Inconsistency
openmetadata-ui/src/main/resources/ui/src/hooks/useInboxInfiniteList.ts gates fetching on canLoadMore:
This bug was introduced in commit 36729ad (PR #33578), which added the client-side bounded-scan feature (MAX_NARROWED_SCAN, scanRaise, scanLimit, canLoadMore, handleScanFurther).
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.
Thanks — the root cause and the Math.max fix are right. Closing in favour of #34820, which moves this scan logic out of TasksTab.tsx into useTaskQueue.ts (shared by the Inbox and the entity Activity Feed), so the fix has to land there. Ported in 346df48 with regression tests in useTaskQueue.test.tsx; #35054 is linked from #34820 and closes when it merges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
safe to testAdd this label to run secure Github workflows on PRs
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detail bug report: View on Detail
Closes #35054
Summary
TasksTabrenders the personal/entity inbox's task list with an IntersectionObserver-driven infinite scroll gated by a client-side "bounded scan" cap (MAX_NARROWED_SCAN = 200) applied whenever the list is narrowed by Type filter, Status filter, or title-search; a "Load more" button in the no-match empty state is supposed to let the user raise that cap and continue scanning.handleScanFurtheradvancesscanLimitby a fixedMAX_NARROWED_SCANstep, butcanLoadMorecompares that cap against the total already-loaded task count (tasks.length), not against the number of tasks loaded since the narrowing was applied; so when more thanMAX_NARROWED_SCANraw tasks were already loaded before narrowing, the raise is smaller than the load andcanLoadMorestaysfalse, so the IntersectionObserver inuseInboxInfiniteListnever callsfetchNextPage.tasks.length.TASK_LIMIT = 25) before narrowing — e.g. scrolling a long Open queue and then picking a Type/Status filter whose matches are none of the loaded rows — the "Load more" button is dead forfloor((tasks.length - 200) / 200)clicks before the next page loads: 1 dead click at 400 loaded, 4 at 1000, 24 at 5000. Below 400 loaded the buggy and fixed code paths are behaviourally indistinguishable.Code with Bug
openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/tabs/TasksTab.tsx:Also in
TasksTab.tsx(empty state wiring):Explanation
useInboxInfiniteListonly callsfetchNextPage()whencanLoadMore(items) !== false. With a narrowed list,canLoadMorereturnsloaded.length < scanLimit.tasks.length = 1000) and then applies a Type/Status filter that yields zero matches among already-loaded tasks,scanLimitstarts at 200 andcanLoadMoreisfalse.scanLimitby 200, socanLoadMoreremainsfalseuntilscanLimitexceeds the entire already-loaded backlog (e.g., 5 clicks to pass 1000). WhilecanLoadMoreisfalse, the IntersectionObserver-triggeredloadMoreno-ops and no network request is sent.Codebase Inconsistency
openmetadata-ui/src/main/resources/ui/src/hooks/useInboxInfiniteList.tsgates fetching oncanLoadMore:Recommended Fix
Raise the scan cap past the already-loaded backlog in one click when it is already exceeded, so the next page fetch can happen immediately.
openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/tabs/TasksTab.tsx:History
This bug was introduced in commit 36729ad (PR #33578), which added the client-side bounded-scan feature (
MAX_NARROWED_SCAN,scanRaise,scanLimit,canLoadMore,handleScanFurther).Automatic Fixes PRs can be configured here.