Skip to content

Bot details: before the task list is read, a Bot with tasks says "No scheduled tasks yet" and its button opens the new-task form #2035

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 9f226a1e999041bc81b0af22aadb7bd3
Branch: dev/2-schedules-unknown-guard
Base: 7c6883a
At: 2026-11-01T12:20:52Z

What happens

In a Bot's details panel, the "Scheduled tasks" line draws its empty state — No scheduled tasks yet. Add one — while the shared schedule view is still unknown (null: not read yet, or the read failed). The button then calls openSettings('schedules', bot.id), which opens the new-task form, so the one place that should list the Bot's tasks offers to create another one instead.

Why, on live main 7c6883a

  • core/src/client/schedules.js:17 let shared = null, :24 useState(shared), and :28-33 runs the first read in an effect. React paints before effects run, so the first frame of any session — nothing has been read yet — has view === null.
  • ScheduleSummary (:424-436) has no view === null guard: :426 const tasks = view?.available ? view.tasks.filter(...) : [] leaves tasks empty, so :432 draws the empty-state button and its openSettings('schedules', bot.id).
  • BotSchedules (:399-402) answers the same state correctly: if (view === null) return null. Two surfaces of the same view disagree; the drawer's line is the wrong one.
  • A first read that rejects is swallowed at :31 (.catch(() => {})), and shared stays null until the 30 s poll succeeds — so the wrong empty state is not always a one-frame flash: it stays until a read lands.

Reproduction (as run against live main source)

A probe that imports core/src/client/schedules.js with a React stub and the resolve hook:

Expected

While the view is unknown, the line draws nothing (matching BotSchedules) or a Loading… row. No scheduled tasks yet. Add one appears only after a read succeeded and the Bot really has no tasks at all; view.available === false keeps its Plugins hint and Open Plugins.

Scope

  • core/src/client/schedules.js: one guard in ScheduleSummary, keeping the available / not-available / empty / capped branches as they are.
  • core/test/schedules-client.test.js: three cases — no view seeded → no empty-state text and no openSettings call; seeded empty view → the empty state and ['schedules', bot.id] stay; seeded five tasks → the Bot details: the Scheduled tasks list draws three rows and never says how many it left out #2030 shape does not regress (title count, three rows, N more not shown with the single-argument openSettings('schedules')).
  • rebuild core/client.js and patches/ds-bot/0008-client-bundle.patch. There is no patches/ds-bot/files/src/client/schedules.js; do not add one.
  • Docs: only if the empty-state sentence is documented; no other surface changes.

Red first: the three new cases must fail on live main and pass at the tip, with the two older cases green on both.

Dedupe

Searched live main 7c6883a5 (the sentence, the symbol, the file) and closed issues:

Activity

  1. HugoXK commented on Nov 1, 2026

    @HugoXK
    ContributorAuthor

    Release

    Written-by: FlyBot Lead
    Released: 9f226a1e999041bc81b0af22aadb7bd3
    Reason: merged into main as #2036, merge sha ed032b8
    At: 2026-11-01T12:54:22Z

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions