njnu-seafish commented on code in PR #18308:
URL:
https://github.com/apache/dolphinscheduler/pull/18308#discussion_r3348277621
##########
dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx:
##########
@@ -131,8 +131,8 @@ const NodeDetailModal = defineComponent({
const restructureNodeData = (data: INodeData) => {
if (!data?.id) {
for (const item in projectPreferences.value) {
- if (projectPreferences.value[item] !== null && item in data) {
- Object.assign(data, { item: projectPreferences.value[item] })
+ if (projectPreferences.value[item] !== null) {
+ Object.assign(data, { [item]: projectPreferences.value[item] })
}
Review Comment:
Fix: use whitelist for project preference fields in task creation
- Replace `item in data` check with explicit allowed fields list
- Ensures project preferences are applied to new tasks even when initial
data object is empty
- Prevents unrelated fields (tenant, alertGroups) from being added to task
node model
- Whitelist includes: taskPriority, workerGroup, environmentCode,
failRetryTimes, failRetryInterval, cpuQuota, memoryMax, timeoutFlag,
timeoutNotifyStrategy, timeout
--
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]