Skip to content

[Detail Bug] Inbox Tasks: "Load more" does nothing after scrolling then applying Type/Status filter #35054

Done

Description

@detail-app

Detail Bug Report

https://app.detail.dev/org_3377c26d-da48-4ccd-b83a-22c542f4fe83/bugs/bug_50ffafd6-1c7a-43d7-8704-bee3d28732d3

Introduced in #33578 by @harsh-vador on Oct 3, 2026

Summary

  • 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.

Code with Bug

openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/tabs/TasksTab.tsx:

const scanKey = JSON.stringify([
  status,
  searchQuery,
  typeFilter,
  statusFilter,
]);
const [scanRaise, setScanRaise] = useState({ key: scanKey, extra: 0 });
const scanLimit =
  MAX_NARROWED_SCAN + (scanRaise.key === scanKey ? scanRaise.extra : 0);
const canLoadMore = 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]
);
const handleScanFurther = useCallback(
  () =>
    setScanRaise((raise) => ({
      key: scanKey,
      // <-- BUG 🔴 raise is fixed +MAX step regardless of how far loaded.length already exceeds it
      extra: (raise.key === scanKey ? raise.extra : 0) + MAX_NARROWED_SCAN,
    })),
  [scanKey]
);

Also in TasksTab.tsx (empty state wiring):

emptyState={
  showEmptyState ? (
    <TasksEmptyState
      isNarrowed={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:

const loadMore = useCallback(() => {
  const allowed = canLoadMore?.(items) !== false;
  if (hasNextPage && !isFetchingNextPage && allowed) {
    fetchNextPage();
  }
}, [hasNextPage, isFetchingNextPage, canLoadMore, items, fetchNextPage]);

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:

const handleScanFurther = useCallback(
  () =>
    setScanRaise((raise) => {
      const base = raise.key === scanKey ? raise.extra : 0;
      return {
        key: scanKey,
        extra: Math.max(base, tasks.length),
      };
    }),
  [scanKey, tasks.length]
);

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).

Activity

  1. added a commit that references this issue on Oct 10, 2026
    346df48
  2. added
    UI
    on Nov 6, 2026
  3. added this to the 2.2 Release - Wave 1 milestone on Nov 9, 2026
  4. added this to Shipping and removed this from Roadmapon Nov 24, 2026
  5. removed this from the 2.2 Release - Wave 1 milestone on Nov 24, 2026
  6. added a commit that references this issue on Nov 25, 2026
    017ff47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

UI

Type

No type

Projects

  • Status
    Done ✅
  • Status
    Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions