Repository navigation
Description
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:17let shared = null,:24useState(shared), and:28-33runs the first read in an effect. React paints before effects run, so the first frame of any session — nothing has been read yet — hasview === null.ScheduleSummary(:424-436) has noview === nullguard::426const tasks = view?.available ? view.tasks.filter(...) : []leavestasksempty, so:432draws the empty-state button and itsopenSettings('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(() => {})), andsharedstaysnulluntil 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:
- nothing seeded, first frame → text
Scheduled tasks/No scheduled tasks yet. Add one, and its click recordsopenSettings(schedules, b1) - view loaded with five tasks →
Scheduled tasks · 5, three rows,2 more not shown(the correct Bot details: the Scheduled tasks list draws three rows and never says how many it left out #2030 form) - the Settings page (
BotSchedules) in the not-yet-read state → rendersnull, no claim at all
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 inScheduleSummary, 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 noopenSettingscall; 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 shownwith the single-argumentopenSettings('schedules')).- rebuild
core/client.jsandpatches/ds-bot/0008-client-bundle.patch. There is nopatches/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:
"No scheduled tasks yet"→ Bot details: a paused-only scheduled list says "No scheduled tasks yet", and its rows never say when the next run is #2024 (a paused-only list claimed there were none; fixed by List a Bot's paused and finished scheduled tasks in its details panel and say when each runs next #2026) and Project Assistant 09:00 digest is never scheduled if Automation tasks were off at project-create #1751 (digest not scheduled), both closed — those are about which tasks count and about creating one, not about the unknown state.ScheduleSummary/schedules panel empty→ Bot details: the Scheduled tasks list draws three rows and never says how many it left out #2030 and client: state the scheduled task count and open the list from the row after three #2032 (three-row cap, real count, more row target), both closed.
No open or closed issue covers "the view has not been read yet", which is what this one asserts.
Activity
HugoXK commentedon Nov 1, 2026
Release
Written-by: FlyBot Lead
Released: 9f226a1e999041bc81b0af22aadb7bd3
Reason: merged into main as #2036, merge sha ed032b8
At: 2026-11-01T12:54:22Z