Skip to content

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Nov 12, 2025

Summary

Show cron errors and disable submission for invalid values. also in the process noticed that any errors that bubble up sometimes just get rendered the wrong way

@DOsinga DOsinga requested a review from zanesq November 12, 2025 22:05
@DOsinga DOsinga marked this pull request as ready for review November 12, 2025 22:05
Copilot AI review requested due to automatic review settings November 12, 2025 22:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds error handling for invalid cron expressions in the schedule modal and improves error display formatting throughout the app.

Key Changes

  • Adds validation state to disable form submission when cron expressions are invalid
  • Catches and displays errors from the cronstrue library when parsing cron expressions
  • Refactors error rendering to use a consistent errorMessage utility function

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
ui/desktop/src/components/schedule/ScheduleModal.tsx Adds isValid state and disables submit button when cron expression is invalid
ui/desktop/src/components/schedule/CronPicker.tsx Implements error handling for cron parsing with try-catch and validation callback
ui/desktop/src/components/ErrorBoundary.tsx Refactors to use string errors and errorMessage utility for consistent formatting
ui/desktop/src/App.tsx Updates fatal error handling to use errorMessage utility

Comment on lines 141 to 148
try {
const cron = cronstrue.toString(cronWithoutSeconds);
isValid(true);
return cron;
} catch (e) {
isValid(false);
return 'error: ' + errorMessage(e);
}
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling isValid() during render (inside getReadable()) violates React best practices - state updates should not occur during render. Move the validation logic to a useEffect that depends on currentCron, and have getReadable() only return the display string without side effects.

Copilot uses AI. Check for mistakes.
@DOsinga DOsinga merged commit 6f97413 into main Nov 19, 2025
18 of 19 checks passed
katzdave added a commit that referenced this pull request Nov 19, 2025
…xt-test

* 'main' of github.com:block/goose:
  chore: Add Adrian Cole to Maintainers (#5815)
  [MCP-UI] Proxy and Better Message Handling (#5487)
  Release 1.15.0
  Document New Window menu in macOS dock (#5811)
  Catch cron errors (#5707)
  feat/fix Re-enabled WAL with commit transaction management (Linux Verification Requested) (#5793)
  chore: remove autopilot experimental feature (#5781)
  Read paths from an interactive & login shell (#5774)
  docs: acp clients (#5800)
wpfleger96 added a commit that referenced this pull request Nov 20, 2025
* main: (33 commits)
  fix: support Gemini 3's thought signatures (#5806)
  chore: Add Adrian Cole to Maintainers (#5815)
  [MCP-UI] Proxy and Better Message Handling (#5487)
  Release 1.15.0
  Document New Window menu in macOS dock (#5811)
  Catch cron errors (#5707)
  feat/fix Re-enabled WAL with commit transaction management (Linux Verification Requested) (#5793)
  chore: remove autopilot experimental feature (#5781)
  Read paths from an interactive & login shell (#5774)
  docs: acp clients (#5800)
  Provider error proxy for simulating various types of errors (#5091)
  chore: Add links to maintainer profiles (#5788)
  Quick fix for community all stars script (#5798)
  Document Mistral AI provider (#5799)
  docs: Add Community Stars recipe script and txt file (#5776)
  chore: incorporate LF feedback (#5787)
  docs: quick launcher (#5779)
  Bump auto scroll threshold (#5738)
  fix: add one-time cleanup for linux hermit locking issues (#5742)
  Don't show update tray icon if GOOSE_VERSION is set (#5750)
  ...
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
Co-authored-by: Douwe Osinga <[email protected]>
Signed-off-by: Blair Allan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants