Fix autopilot schedule preview version mismatch (ZIC-121)#5907
Open
vicksiyi wants to merge 1 commit into
Open
Conversation
Co-authored-by: multica-agent <github@multica.ai>
|
@vicksiyi is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes the autopilot schedule editor's error mapping when a newer web frontend talks to an older backend that does not have
GET /api/autopilots/cron-preview.Older backends can route
cron-previewas/api/autopilots/{id}and return400 {"error":"invalid autopilot id"}. The editor previously treated that 400 as a cron rejection, so valid cron like0 10 * * *could be shown as invalid. This PR detects unsupported preview endpoints separately, keeps the schedule submittable, and shows localized self-host/backend-version guidance instead of a cron error.Related Issue
Closes #5865
Multica issue: ZIC-121
Type of Change
Changes Made
isCronPreviewUnsupportedclassification for missing/unsupported preview routes, including the legacyinvalid autopilot id400.How to Test
GET /api/autopilots/cron-preview.0 10 * * *withAsia/Shanghai.Local validation:
pnpm --filter @multica/views exec vitest run autopilots/components/schedule-editor/validate.test.tspnpm --filter @multica/views exec vitest run autopilots/components/schedule-editor/schedule-editor.test.tsxpnpm --filter @multica/views typecheckpnpm --filter @multica/views lint(passes with existing warnings outside this change)make check-worktreewas attempted, but the local Docker daemon was unavailable while the target checked PostgreSQL, so the full worktree pipeline did not progress past DB setup.Checklist
apps/web/features/landing/i18n/) and relevant docs (apps/docs/content/docs/)apps/docs/content/docs/developers/conventions.zh.mdx(terminology, mixed-rule fortask/issue/skill)AI Disclosure
AI tool used: Multica Agent
Prompt / approach:
Traced the schedule editor preview query and submit gate, reproduced the mismatch via targeted mocked
ApiErrorresponses, then added the smallest UI-side classification and localized message changes with focused Vitest coverage.Screenshots (optional)
Not included. This change is copy/error-state handling covered by component tests; no local backend with the old route shape was available for a live before/after screenshot.