mirror of https://github.com/langgenius/dify.git
chore: address review feedback
This commit is contained in:
parent
4f73766a21
commit
715f3affe5
|
|
@ -957,6 +957,7 @@ export const useChat = (
|
|||
})
|
||||
},
|
||||
onNodeStarted: ({ data: nodeStartedData }) => {
|
||||
// `data` is the outer send payload for this request; loop child runs should not emit top-level node traces here.
|
||||
if (data.loop_id)
|
||||
return
|
||||
|
||||
|
|
@ -977,6 +978,7 @@ export const useChat = (
|
|||
})
|
||||
},
|
||||
onNodeFinished: ({ data: nodeFinishedData }) => {
|
||||
// Use the outer request payload here as well so loop child runs skip top-level finish handling entirely.
|
||||
if (data.loop_id)
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ const Result: FC<IResultProps> = ({
|
|||
onIterationFinish: ({ data }) => {
|
||||
setWorkflowProcessData(produce(getWorkflowProcessData()!, (draft) => {
|
||||
draft.expand = true
|
||||
const iterationsIndex = draft.tracing.findIndex(item => item.id === data.id)!
|
||||
const iterationsIndex = draft.tracing.findIndex(item => item.id === data.id)
|
||||
if (iterationsIndex > -1) {
|
||||
draft.tracing[iterationsIndex] = {
|
||||
...data,
|
||||
|
|
@ -367,7 +367,7 @@ const Result: FC<IResultProps> = ({
|
|||
onLoopFinish: ({ data }) => {
|
||||
setWorkflowProcessData(produce(getWorkflowProcessData()!, (draft) => {
|
||||
draft.expand = true
|
||||
const loopsIndex = draft.tracing.findIndex(item => item.id === data.id)!
|
||||
const loopsIndex = draft.tracing.findIndex(item => item.id === data.id)
|
||||
if (loopsIndex > -1) {
|
||||
draft.tracing[loopsIndex] = {
|
||||
...data,
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export const upsertTopLevelTracingNodeOnStart = (
|
|||
? tracing.findIndex(item => item.id === startedNode.id)
|
||||
: tracing.findIndex(item => item.node_id === startedNode.node_id)
|
||||
if (currentIndex > -1)
|
||||
// Started events are the authoritative snapshot for an execution; merging would retain stale client-side fields.
|
||||
tracing[currentIndex] = startedNode
|
||||
else
|
||||
tracing.push(startedNode)
|
||||
|
|
|
|||
Loading…
Reference in New Issue