github-actions[bot] commented on issue #18662:
URL: 
https://github.com/apache/dolphinscheduler/issues/18662#issuecomment-5775844664

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar feature requirement.
   
   
   ### Description
   
   ### 1,Describe the bug
   When a workflow is in the OFFLINE state, the "Timing" button in the 
operation column is enabled (no disabled condition). 
   
   <img width="2246" height="464" alt="Image" 
src="https://github.com/user-attachments/assets/04a9e6df-c931-4e10-b225-cae43fb619ec";
 />
   
   However, clicking it and saving a new schedule returns an error: "workflow 
definition not online" (error code 50004).
   
   <img width="1459" height="1135" alt="Image" 
src="https://github.com/user-attachments/assets/0271581b-e501-442a-8895-f47bcbcec889";
 />
   
   ### 2,Steps to reproduce
   (1) Create a workflow and keep it offline (do not click "Go Online").
   (2) In the workflow definition list, click the Timing button (clock icon) in 
the operation column.
   (3) Fill in the cron expression and time range, then click Save.
   (4) Observe the error message: "工作流定义[xxx] 工作流版本[xxx]不是上线状态" (en: "workflow 
definition {0} workflow version {1} not online").
   
   ### 3,Expected behavior
   Either:
   (A) The backend allows creating a schedule for an offline workflow (since 
the newly created schedule is itself OFFLINE and will not take effect until 
manually switched online), making the behavior consistent with updateSchedule, 
which already permits modification for offline workflows; 
   
   or
   (B) The frontend disables the "Timing" button for offline workflows, making 
the UI consistent with the backend constraint.
   
   
   ### 4,Key observations:
   
   insertSchedule (SchedulerServiceImpl.java:134) calls 
checkWorkflowDefinitionValid, which enforces releaseState == ONLINE 
(ExecutorServiceImpl.java:173-175).
   
   updateSchedule (SchedulerServiceImpl.java:226-261) does not perform this 
check — it only verifies the workflow exists and the schedule itself is not 
already online.
   
   The newly created schedule is set to ReleaseState.OFFLINE 
(SchedulerServiceImpl.java:183), so it does not take effect until a separate 
"schedule online" action is performed — and that action (doOnlineScheduler) 
already has its own online check as a guard.
   The frontend table-action.tsx does not set a disabled condition on the 
Timing button, and use-modal.ts has no pre-save state validation either.
   
   ### 5,Why this is inconsistent
   
   Creating a schedule while offline is rejected, but modifying an existing 
schedule while offline is allowed.
   The schedule created by insertSchedule is already OFFLINE by default and 
poses no risk — the actual enforcement point (schedule online) already 
validates the workflow state.
   This means the insertSchedule online-check is stricter than necessary and 
inconsistent with updateSchedule.
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to