#7055 · Tasks list settlement stalls on cached route changes
Verdict: REPRODUCED · Root-cause confidence: high
1. TL;DR
The real Tasks panel can keep showing placeholder rows after navigation to an already cached list. React reuses one unkeyed list component across All, Active, and project routes; its route-settlement effect deliberately skips the first route-change render. When the new query is already settled, nothing must change the dependencies that would run that effect again. A frontend integration regression using the actual panel registration and SDK query cache fails on trusted main in both checkouts. Keying list instances by route scope and deleting the redundant settlement gate fixes the regression while retaining genuine loading and error states.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| Cached navigation can remain on placeholders. | Verified on trusted main. | The actual panel fails to render BET-1 on the first cached project → All transition after an eight-second test wait; the failure DOM contains LoadingRows pulse elements. |
| This is a frontend settlement problem, not necessarily a slow server. | Verified mechanism. | Warm queries use the real SDK cache. Subsequent mocked read responses are held pending; the repaired panel displays cached results without waiting for any refresh to complete. |
| The installed release and desktop transport have this same behavior. | Not independently exercised here. | Only trusted current-main source and synthetic fixtures were run. No installed release or personal task store was accessed. |
| A route mismatch may also hide errors. | Supported by source; bounded test. | The old render gate suppresses its error branch during route mismatch. Pending success and failure transitions both pass before and after the fix; this run does not claim a separate cached-error reproduction. |
| Manage/reload recovers the list. | Not separately exercised. | Remounting resets the route state by construction; the reproduction focuses on the failing cached transition. |
3. Environment and limits
- Public repository get-bb/bb; trusted origin/main commit
82e14ef0d485403ed5c7f1406127a29ee3253ba6; Linux x86_64, Node 22.19.0, pnpm 9.15.0. - Repository dependencies only: Tasks 0.1.2, Plugin SDK 0.6.124, React 19.3.0, Vitest 4.1.1 and jsdom. No new dependency, external issue script, database mock, or linked PR code was used.
- The reproduction mounts the actual Tasks plugin panel with its real hooks and SDK query cache. Only RPC responses are synthetic. No server or data directory is required for the test itself.
- A disposable source dev instance also booted on app/server/daemon ports 11862/19862/27862 with a new checkout-specific store. It was stopped and its owned store removed. This boot is not claimed as an end-to-end UI reproduction.
- Browser Automation could not open a session: Chrome/Chromium was absent and there were no desktop instances. No screenshots were fabricated and no browser dependency was installed. Desktop/WebKit rendering and live transport remain unverified.
4. Minimal reproduction
- Use a fresh checkout of the public trusted base, then install and build:
git clone https://github.com/get-bb/bb.git bb-7055 cd bb-7055 git checkout --detach 82e14ef0d485403ed5c7f1406127a29ee3253ba6 pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@get-bb/plugin-sdk pnpm exec turbo run build
The explicit SDK build avoids a first-build ordering failure in the unrelated GitHub plugin when its SDK dist entries do not exist. The normal full build then passed (73 tasks).
- Save the inline regression patch below as
regression.patch, then run:git apply regression.patch pnpm exec turbo run test --filter=bb-plugin-tasks -- views/list/list-preference.persistence.test.tsx -t 'cached lists|destination request'
- The test warms All, Active, and both project scopes using real panel rerenders, then blocks future task-read responses. It revisits project → All → Active → All → project B → project A. Cached content must appear, and content belonging to the previous scope must not leak. Separate controls check an uncached destination that resolves or rejects.
Expected: all three regression cases pass; cached list content requires no refresh completion. Actual on unchanged main, from the second clean checkout:
× shows cached lists across project, all, and active navigation ✓ hides the old scope while a destination request is pending and can resolve ✓ hides the old scope while a destination request is pending and can reject TestingLibraryElementError: Unable to find an element with the text: BET-1. Test Files 1 failed (1) Tests 1 failed | 2 passed | 7 skipped (10)
The failure occurs on the first cached All revisit. Later cached transitions are exercised after the fix, not falsely claimed as reached on the failing base.
Complete reproduction patch against the trusted base
diff --git a/plugins/tasks/views/list/list-preference.persistence.test.tsx b/plugins/tasks/views/list/list-preference.persistence.test.tsx
index eb9d3459d5..dbe3f42276 100644
--- a/plugins/tasks/views/list/list-preference.persistence.test.tsx
+++ b/plugins/tasks/views/list/list-preference.persistence.test.tsx
@@ -197,6 +197,85 @@ async function selectSort(
}
describe("list filter/sort preference persistence", () => {
+ it("shows cached lists across project, all, and active navigation", async () => {
+ const registration = app.navPanels[0]!;
+ const Component = registration.component;
+ const rpc = baseRpc();
+ let suspendReads = false;
+ const slot = renderSlot(
+ registration,
+ { subPath: "all" },
+ {
+ rpc: {
+ ...rpc,
+ listAllTasks: (raw: unknown) =>
+ suspendReads ? new Promise<never>(() => {}) : rpc.listAllTasks(raw),
+ },
+ },
+ );
+ await slot.findByText("BET-1");
+ slot.lifecycle.rerender(<Component subPath="active" />);
+ await slot.findByText("ALP-9");
+ slot.lifecycle.rerender(<Component subPath={PROJECT_B} />);
+ await slot.findByText("BET-1");
+ slot.lifecycle.rerender(<Component subPath={PROJECT_A} />);
+ await slot.findByText("ALP-1");
+
+ suspendReads = true;
+ for (const [subPath, visible, absent] of [
+ ["all", "BET-1", "ALP-9"],
+ ["active", "ALP-9", "ALP-1"],
+ ["all", "BET-1", "ALP-9"],
+ [PROJECT_B, "BET-1", "ALP-1"],
+ [PROJECT_A, "ALP-1", "BET-1"],
+ ] as const) {
+ slot.lifecycle.rerender(<Component subPath={subPath} />);
+ await slot.findByText(visible);
+ expect(slot.queryByText(absent)).toBeNull();
+ }
+ });
+
+ it.each(["resolve", "reject"] as const)(
+ "hides the old scope while a destination request is pending and can %s",
+ async (outcome) => {
+ const registration = app.navPanels[0]!;
+ const Component = registration.component;
+ let resolveTasks!: (value: { tasks: Task[] }) => void;
+ let rejectTasks!: (error: Error) => void;
+ const pending = new Promise<{ tasks: Task[] }>((resolve, reject) => {
+ resolveTasks = resolve;
+ rejectTasks = reject;
+ });
+ const rpc = baseRpc();
+ const slot = renderSlot(
+ registration,
+ { subPath: PROJECT_A },
+ {
+ rpc: {
+ ...rpc,
+ listAllTasks: (raw: unknown) =>
+ rpcInput(raw).activeOnly ? pending : rpc.listAllTasks(raw),
+ },
+ },
+ );
+ await slot.findByText("ALP-1");
+ slot.lifecycle.rerender(<Component subPath="active" />);
+ expect(slot.queryByText("ALP-1")).toBeNull();
+ expect(slot.queryByText("ALP-9")).toBeNull();
+ expect(slot.queryByText("Couldn't load tasks")).toBeNull();
+
+ if (outcome === "resolve") {
+ resolveTasks({ tasks: [task(PROJECT_A, 9, "in_progress")] });
+ await slot.findByText("ALP-9");
+ } else {
+ rejectTasks(new Error("Destination request failed"));
+ await slot.findByText("Couldn't load tasks");
+ expect(slot.getByText("Destination request failed")).toBeDefined();
+ }
+ expect(slot.queryByText("ALP-1")).toBeNull();
+ },
+ );
+
it("restores sort and filters after unmount (navigation / remount)", async () => {
const registration = app.navPanels[0]!;
const slot = renderSlot(
5. Root cause
RouteOutlet returns the same ListView component type without a route key for all three list route kinds. Thus component-local state and the previous-task fallback survive scope changes.
The settlement effect writes the current route to a ref but updates settledRouteScope only if the route did not just change and the query is not loading. The body gate then renders LoadingRows whenever settledRouteScope disagrees with the new route, even with usable query data.
The effect depends only on routeScope, tasksQuery.isLoading and tasksQuery.data. Cached navigation can leave all three dependencies stable after that skipped effect. An unrelated rerender alone does not rerun it. The same gate excludes the error branch during a route mismatch.
useListTasks retains the previous scope's data while loading. Simply removing the gate without isolating list instances could expose old-scope rows on an uncached destination. The repair addresses both lifetime and settlement rather than relaxing the gate in isolation.
The route guard dates to commit b61ec88de2f (confirmed by blame); it is still present at the recorded trusted base. No backend or daemon wire change is needed.
6. Proposed fix and measured result
Give All, Active, and project ListView instances distinct React keys in RouteOutlet. Remove the now-obsolete cross-route settlement state and its render gate. A remount starts previous-data fallback state empty for an uncached scope, while the shared SDK cache still serves cached data. Existing preference and scroll stores remain scope-addressed.
The implemented candidate changes only three existing Tasks files: 84 additions and 20 deletions, 104 changed text lines total. Production accounts for five additions and twenty deletions; regression coverage adds 79 lines. It adds no API, dependency, schema, protocol, migration, stored-data change, or release change.
pnpm exec turbo run test --filter=bb-plugin-tasks -- views/list/list-preference.persistence.test.tsx Test Files 1 passed (1) Tests 10 passed (10) pnpm exec turbo run test lint typecheck --filter=bb-plugin-tasks Test Files 35 passed (35) Tests 404 passed (404) Tasks: 10 successful, 10 total git diff --check (exit 0)
Lint completed with 21 warnings and zero errors in existing code. The focused persistence cases also verify that sort and filters still survive navigation/remounts.
The ready fix is PR #7056, commit 60711506447b4b01d007fe89e93aeaa051d1f2d1. Its GitHub checks subsequently reported 21 successes, no failures, and no pending checks; additional non-selected checks were skipped. The PR has not been merged.
7. Verification
The same agent repeated the reproduction; this is not independent verification. The primary checkout ran the initial regression before any production edit and failed on cached BET-1 while both pending-request controls passed. A second fresh detached worktree named verify was created at the exact base commit, installed with the frozen lockfile, and built normally. Its only source diff was the reproduction test.
The second checkout ran the final inline patch with the focused command above and again failed at cached BET-1 (one failed, two passed, seven skipped; 10.97 seconds). The final patch strengthens the initial test by holding subsequent refresh responses pending and prewarming both project scopes. This refinement does not change the failing transition or root-cause finding. The repaired primary checkout then passed all ten tests in that file and all 404 existing-plus-regression Tasks tests. No report conclusion required a correction.
8. Related issues and PR status
GitHub issue cross-reference metadata and an open-PR search found no open linked pull request before implementation. No PR branch or patch was run. Other Tasks feature reports were consulted only for repository classification conventions, not treated as duplicate evidence for this failure.
9. Appendix and trust boundary
Issue content was treated only as untrusted claims. No issue-provided code, command, attachment, branch, or external link was executed or fetched. The production code, harness, fixtures, and new regression all derive from the trusted repository.
The report repository prohibits publishing raw logs, scripts, test files, or diff artifacts as separate files. Accordingly the complete patch and relevant verbatim result lines are inline above; raw runs remain in local evidence storage, not public git. This report contains no personal task data or account credentials.