fix(ui): guard against undefined cron job payload in render loop#38766
fix(ui): guard against undefined cron job payload in render loop#38766luka2chat wants to merge 4 commits into
Conversation
Greptile SummaryThis PR adds defensive Key observations:
Confidence Score: 4/5
Last reviewed commit: 63ec946 |
63ec946 to
8f8de32
Compare
When a cron job's payload field is undefined, directly accessing job.payload.kind throws a TypeError. Since this happens inside the LitElement render() method, it triggers on every reactive update, creating an infinite error loop that freezes the entire dashboard UI. Add optional chaining guards to all job.payload access sites in app-render.ts, controllers/cron.ts, and views/cron.ts. Made-with: Cursor
Address review feedback: document why payloadKind defaults to "agentTurn" when job.payload is undefined. Made-with: Cursor
8f8de32 to
8106b06
Compare
Same undefined payload issue as the UI fix, but in the CLI cron list table renderer. Prevents TypeError when listing cron jobs with missing payload data. Made-with: Cursor
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thanks for the earlier UI-side guard here. I’m closing this as superseded by #71534, which fixes the root persisted-row shape by hydrating flat legacy cron jobs into canonical If there is another current-main path that still returns a cron job without payload/schedule, reply with that payload and I can reopen this quickly. |
Summary
payloadfield isundefined(e.g. from incomplete API data or legacy jobs), directly accessingjob.payload.kindinapp-render.tsthrowsTypeError: Cannot read properties of undefined (reading 'kind').render()method, it triggers on every reactive update, creating an infinite error loop that freezes the entire dashboard UI — users cannot switch tabs or interact with the page at all.?.) guards to alljob.payloadaccess sites inapp-render.ts,controllers/cron.ts, andviews/cron.ts, with an early-returnnothingguard inrenderJobPayload().Reproduction
payload: undefinedTypeError: Cannot read properties of undefined (reading 'kind')errorsTest plan
vite buildcompiles successfully with no type errorscontrollers/cron.test.ts— all 27 tests passMade with Cursor