Skip to content

bug(platform): a task page whose read fails says "Page not found" instead of offering Try again #4587

Closed

Description

@yannickmonney

Summary

A task opened as a page (/dashboard/$id/tasks/$taskId, how Home and Open as page open a task) treats a failed read as a missing task. If the task read fails for any reason other than the task being gone (offline, a server error, a lapsed connection), the page shows the platform's not-found dead end:

Page not found
The page you're looking for doesn't exist or may have been moved.
[Back to Home]

Nothing says the read failed, and there is no Try again. The read is tried again only when the tab regains focus (the app QueryClient's refetchOnWindowFocus for errored reads, app/router.tsx:45–47), when the browser reconnects, or on a reload. Until then the page states that the task doesn't exist. Someone who follows a notification or a shared task link on a flaky connection may conclude the task was deleted and leave.

The board's task dialog already separates the two cases (TaskDetailFallback with state: 'missing' | 'error'). The page doesn't.

Source

The code path:

  • useTask already separates the cases (services/platform/app/features/tasks/hooks/queries.ts:168–198):
    • task: data?.task ?? null;
    • error: "the read failed for a reason other than the task being gone";
    • notFound: settled and gone.
  • TaskDetailPage ignores the difference (services/platform/app/features/tasks/components/task-detail-page.tsx):
    • it reads only const { task, isLoading } = useTask(taskId);;
    • then if (!isLoading && task === null) return <DashboardNotFound organizationId={organizationId} />;.
    • So a settled failed read (data undefined, isLoading false) renders not-found.
  • The route can't intercept it. Its loader (app/routes/dashboard/$id/tasks/$taskId.tsx:14–19) only starts prefetchAdaptedQuery without awaiting it, so it never throws a read failure to a route error component.
  • The dialog surface does it right (task-modal.tsx:1505–1510): notFound || readError != null → TaskDetailFallback with missing or error. Its comment says "The page surface has its own dead end (TaskDetailPage)".
  • Not tested: task-detail-page.test.tsx mocks useTask as { task, isLoading } only. It covers "the task is gone" (line 63) but no failed read.

The same not-found text ships in German ("Seite nicht gefunden … existiert nicht oder wurde möglicherweise verschoben") and French ("Page introuvable … n'existe pas ou a peut-être été déplacée").

Reproduction (expected from the code; not run live)

  1. Open a task as a page, from Home or with Open as page in the board dialog, so the address is /dashboard/<org>/tasks/<taskId>.
  2. Make tasks/queries:getTask fail with something other than a task-missing code (go offline before a reload, or have the backend answer with a server error), and reload.
  3. After the read settles, the page shows Page not found with Back to Home for a task that exists.

Expected

  • Gone (notFound): keep the current dead end.
  • Failed (error set): say the task couldn't load, keep the person on the page, and offer Try again (refetch).
  • The dialog's error state would also benefit from Try again; today it offers only Close.

Regression expectation

Extend task-detail-page.test.tsx:

  • with { task: null, isLoading: false, error: <non-missing error>, notFound: false }, the not-found heading is absent, a load-failure message and Try again are present, and Try again refetches;
  • the existing "gone" case keeps its dead end.

Triage

Activity

  1. yannickmonney commented on Oct 9, 2026

    @yannickmonney
    ContributorAuthor

    Review A (TALE-358) addendum: a second read on the same page (main da07e4933, static).

    The task's conversation shows the empty-thread invitation when its discussion read fails or hasn't settled:

    No comments yet — start the conversation below.

    German: "Noch keine Kommentare – beginne die Unterhaltung unten." French: "Aucun commentaire pour le moment — lance la conversation ci-dessous." This happens in both the board dialog and the task page.

    • The read: useTaskDiscussion (app/features/tasks/hooks/queries.ts:257–272) wraps useCachedPaginatedQuery, which reports error and errorCount. It returns only comments, isLoading, hasEarlier, isLoadingEarlier and loadEarlier.
    • The render: TaskConversation (components/task-conversation.tsx:284–287) shows detail.conversationEmpty (or detail.noComments) whenever no rows are present. It doesn't read isLoading, and has no failure branch.
    • Not tested: task-conversation.test.tsx:275 pins the empty invitation for a truly empty thread, with no failed or pending case.
    • History: the branch dates from feat(platform): put chats, tasks and the inbox in one Home panel #3492. Last night's thread work (feat(platform): read task discussions like a chat thread #4559, a6bff1933) kept it.

    Expected: the same split as above. A failed discussion read says the comments couldn't load and offers Try again; a pending read shows a loading state. The invitation stays for a settled empty thread.

    Regression expectation: a task-conversation test with a failed discussion read shows the failure and Try again, not the invitation.

  2. yannickmonney commented on Oct 12, 2026

    @yannickmonney
    ContributorAuthor

    Addendum 2 at main 363c476b5 (Review A, TALE-358, 2026-10-12 12:15 Zurich occurrence; static reading).

    Three more reads on the task page drop their error and report "nothing" instead (services/platform/app/features/tasks/hooks/queries.ts:202-231):

    Hook Returns on failure Where it shows
    useTaskDependencies blockedBy: [], blocks: [] components/task-dependencies.tsx:60: the section says detail.noDependencies (:306), or collapses (:116-117)
    useTaskLabels labels: [] components/label-editor.tsx:60, label-manage-dialog.tsx:50: "No labels yet." (labels.empty)
    useSubtasks subtasks: [] components/task-modal.tsx:1417: the client's open-subtask view is empty, so its parent-close hint can't apply

    Expected: as for the task read itself, distinguish "none" from "couldn't load", with Try again, for each of these sections.

  3. added
    agent-ready
    on Oct 29, 2026
  4. added a commit that references this issue on Oct 30, 2026
    6c3ba24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions