Skip to content

discovery(frontend): useProbeBackedHealth JSDoc claims null-on-error but implementation returns buildUnavailable() #10119

Closed

Description

@mrveiss

Found during #9866 (U7 #9926)

autobot-frontend/src/composables/useProbeBackedHealth.ts:76 — the JSDoc says the factory returns null on fetch error ("null-on-fetch-error"), and the signature is () => Promise<R | null>. But the implementation's catch block returns buildUnavailable('Service unavailable') and never actually returns null.

Impact

Consumers coded against the documented null branch (e.g. if (res === null)) will never hit it — the error path silently yields an 'unavailable' health object instead. Stale docstring vs real behavior.

Needed

  • Either update the JSDoc + return type to reflect that it always resolves to R (never null), or restore the null-on-error path if that was the intended contract.

Refs

Activity

  1. added a commit that references this issue on Jun 21, 2026
  2. github-actions commented on Jun 21, 2026

    @github-actions
    Contributor

    PR #10402 (merged to Dev_new_gui) references this issue with a close keyword.

    complete #9922 tail: footgun guard, health composable contract, system-status resilience, formatter hardening (#10234, #10119, #10347, #10208)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  3. mrveiss commented on Jun 21, 2026

    @mrveiss
    OwnerAuthor

    Resolved — merged as ae7951628 (PR #10402). useProbeBackedHealth typed+documented as Promise<R> (always resolves R via buildUnavailable, never null); FRONTEND_COMPOSABLES.md updated. No consumer relied on the unreachable null branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions