Skip to content

fix(ui): tolerate malformed cron payloads in chat nav#54550

Closed
SnowSky1 wants to merge 2 commits intoopenclaw:mainfrom
SnowSky1:codex/54439-chat-nav-cron-payload
Closed

fix(ui): tolerate malformed cron payloads in chat nav#54550
SnowSky1 wants to merge 2 commits intoopenclaw:mainfrom
SnowSky1:codex/54439-chat-nav-cron-payload

Conversation

@SnowSky1
Copy link
Copy Markdown
Contributor

Summary

  • guard cron model suggestion generation against jobs with missing payloads
  • ignore malformed cron entries instead of crashing the Control UI render path
  • add a jsdom regression test that locks in the no-throw behavior

Verification

  • pnpm --dir ui test -- --project unit src/ui/app-render.test.ts
  • pnpm exec oxfmt --check ui/src/ui/app-render.ts ui/src/ui/app-render.test.ts

Closes #54439

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS r: too-many-prs Auto-close: author has more than twenty active PRs. labels Mar 25, 2026
@SnowSky1
Copy link
Copy Markdown
Contributor Author

@codex review

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because the author has more than 10 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 25, 2026

Greptile Summary

This PR adds a targeted defensive guard in app-render.ts against cron jobs with missing/undefined payloads that previously caused the Control UI render path to throw. The fix extracts job.payload into a local variable and uses optional chaining (payload?.kind) before the existing kind-check, so malformed entries short-circuit to "" and are filtered out of the model-suggestions set. A jsdom regression test in app-render.test.ts locks in the no-throw behavior.

  • Changed job.payload.kindpayload?.kind to guard against undefined payloads before property access
  • Extracted job.payload into a const payload for clarity (consistent with the existing typeof job.agentId === "string" defensive pattern nearby)
  • Added a Vitest/jsdom unit test that injects a cron job with payload: undefined and asserts renderApp does not throw

Confidence Score: 5/5

  • This PR is safe to merge — the fix is minimal, correct, and fully covered by a regression test.
  • The change is a single-line defensive guard using optional chaining (payload?.kind), which is the idiomatic pattern already used elsewhere in the same function for job.agentId. The logic is straightforward: an undefined payload causes payload?.kind !== "agentTurn" to evaluate to true, returning "" which is then filtered out — exactly the desired behavior. A jsdom regression test directly covers the crash scenario. No unintended side effects are introduced.
  • No files require special attention.

Reviews (1): Last reviewed commit: "fix(ui): tolerate malformed cron payload..." | Re-trigger Greptile

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

BunsDev added a commit that referenced this pull request May 2, 2026
Fix Control UI blank sections caused by malformed persisted cron rows.

- filter invalid cron payloads at the cron.list UI boundary
- guard stale cron payload reads in render, edit, and detail paths
- add regression coverage for malformed cron rows from #55047 and #54439

Closes #55047.
Closes #54439.
Supersedes #54550.
Supersedes #54552.
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
Fix Control UI blank sections caused by malformed persisted cron rows.

- filter invalid cron payloads at the cron.list UI boundary
- guard stale cron payload reads in render, edit, and detail paths
- add regression coverage for malformed cron rows from openclaw#55047 and openclaw#54439

Closes openclaw#55047.
Closes openclaw#54439.
Supersedes openclaw#54550.
Supersedes openclaw#54552.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
Fix Control UI blank sections caused by malformed persisted cron rows.

- filter invalid cron payloads at the cron.list UI boundary
- guard stale cron payload reads in render, edit, and detail paths
- add regression coverage for malformed cron rows from openclaw#55047 and openclaw#54439

Closes openclaw#55047.
Closes openclaw#54439.
Supersedes openclaw#54550.
Supersedes openclaw#54552.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui r: too-many-prs Auto-close: author has more than twenty active PRs. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI - Cannot switch back to chat after clicking other sidebar items (TypeError: Cannot read properties of undefined (reading 'kind'))

1 participant