Skip to content

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

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

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

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

@SnowSky1
Copy link
Copy Markdown
Contributor Author

@codex review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 25, 2026

Greptile Summary

This PR adds a targeted null-safety guard in app-render.ts to tolerate cron jobs whose payload field is undefined (or otherwise malformed). Previously, accessing job.payload.kind on such a job would throw a TypeError and crash the Control UI render path. The fix introduces optional chaining (payload?.kind) so malformed jobs are silently skipped instead of surfacing as exceptions.

  • app-render.ts: Extracts job.payload into a local variable and uses payload?.kind to short-circuit safely when the payload is absent, matching the existing filter(Boolean) sentinel-return pattern already used throughout the same pipeline.
  • app-render.test.ts: New jsdom regression test that constructs an OpenClawApp with a deliberately undefined payload and asserts renderApp does not throw, locking in the no-crash guarantee.

Confidence Score: 5/5

  • Safe to merge — the change is a one-line defensive guard with a dedicated regression test and no behavioral impact on well-formed data.
  • The fix is minimal, correct, and consistent with patterns already used in the same code block (e.g., job.delivery?.to on line 364). The regression test directly exercises the crash path and will catch any reversion. No unrelated code is touched.
  • 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. Keep them coming!

ℹ️ 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".

@SnowSky1
Copy link
Copy Markdown
Contributor Author

Quick note on the remaining Windows shard:

  • checks-windows (node, test, 8, 9, pnpm test) is currently showing as failed, but the job log itself completed the test run successfully.
  • The shard finished with 126 passed test files / 1002 passed tests and every recorded step in the Actions job completed with success.
  • GitHub currently reports the job conclusion as cancelled, so this looks like CI/job bookkeeping noise rather than a failure in the files touched by this PR.

This PR still only changes:

  • ui/src/ui/app-render.ts
  • ui/src/ui/app-render.test.ts

@SnowSky1
Copy link
Copy Markdown
Contributor Author

@Takhoffman when you have a moment, could you take a quick look?

This is back to a very small web-ui fix: a null-safe guard plus one focused regression test. The only remaining non-green signal is a Windows shard that GitHub recorded as cancelled, but that job log itself finished with 126 passed test files / 1002 passed tests and all recorded steps succeeding.

Thanks!

@SnowSky1
Copy link
Copy Markdown
Contributor Author

@BunsDev when you have a moment, could you take a quick look?

This is a very small web-ui regression fix for #54439: one null-safe guard plus one focused jsdom regression test.

All substantive checks are green. The only non-green signal is checks-windows (node, test, 8, 9, pnpm test), which GitHub recorded as cancelled even though that shard's log completed with 126 passed test files / 1002 passed tests and all recorded steps succeeding.

Thanks!

@SnowSky1
Copy link
Copy Markdown
Contributor Author

SnowSky1 commented Apr 4, 2026

Closing this to free active PR slots and refocus on fresher post-update issues. This stayed blocked behind noisy CI / reviewer attention rather than the small web-ui fix itself.

@SnowSky1 SnowSky1 closed this Apr 4, 2026
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

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