Skip to content

Prompt detail page hangs on the loading skeleton forever when the data fetch fails #591

Closed

Description

@gkhngyk

Problem

The prompt detail page awaits getPromptDetail with no try/catch. If the server action rejects (network hiccup, transient server error), the promise rejection skips straight past setLoading(false), leaving the page on its skeleton forever — no error message, no retry, and the date-filter changes that re-run the effect are the user's only accidental way out.

Evidence

  • prompts/[id]/page.tsx#L629-L649 — load() awaits getPromptDetail unguarded; setLoading(false) is the last line and is never reached on rejection
  • The sibling list page handles the same failure correctly with try/catch/finally + toast.error: prompts/page.tsx#L946-L967
  • The workflow fetch in the same detail file already guards its own call (#L614), so the gap is one function.

Suggested fix

Wrap the body of load() in try/catch/finally: move setLoading(false) into finally, and on catch surface a toast.error (matching the list page) — an inline error state with a retry button is a welcome extra.

Acceptance criteria

  • A rejected getPromptDetail leaves the page in a non-loading state with a visible error, not a permanent skeleton.
  • The cancelled guard still prevents state updates after unmount.

Activity

  1. added
    bug
    good first issue
    on Aug 3, 2026
  2. BharadwajKanneveti commented on Aug 3, 2026

    @BharadwajKanneveti
    Contributor

    Hi @gkhngyk Can I work on this issue?

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

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions