langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
46.73k stars 6.6k forks source link

Fix: output var validate keyAlreadyExists behavior. #5620

Closed aixgeek closed 2 months ago

aixgeek commented 3 months ago

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # 5625

Type of Change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Suggested Checklist:

aixgeek commented 3 months ago

5615 output var validate keyAlreadyExists. This behavior prevent input. when outputs have same prefix.

zxhlyh commented 3 months ago

image After clearing the variable type, selecting the type again will result in an error.

aixgeek commented 2 months ago

fixed

aixgeek commented 2 months ago

@zxhlyh dify outputs panel have two bugs:

  1. when add new var, the new var maybe duplicate var name.
  2. when change var name, the validate in change event can prevent normal input.

I have fixed these bugs.

iamjoel commented 2 months ago

@VincePotato Do you think it's necessary to auto rename the variable name when it's duplicate?

aixgeek commented 2 months ago

@iamjoel add a duplicate will cause a serious bug. Steps to Reproduce: 1.add a var, it has same name 2.delete this var, it will delete the same var's type 3.can't choose var's type

image

iamjoel commented 2 months ago

@iamjoel add a duplicate will cause a serious bug. Steps to Reproduce: 1.add a var, it has same name 2.delete this var, it will delete the same var's type 3.can't choose var's type

image

I'll fix the bug later.

VincePotato commented 2 months ago

@VincePotato Do you think it's necessary to auto rename the variable name when it's duplicate?

I think we should notify and guide users to rename instead of automatically creating names, as automatically generated names usually lack distinctiveness.

aixgeek commented 2 months ago

@VincePotato @iamjoel This pr is not rename the variable name. The major job is fix validate in change event.

duplicate name problem is a extra work, it fix some problems.

iamjoel commented 2 months ago

@iamjoel add a duplicate will cause a serious bug. Steps to Reproduce: 1.add a var, it has same name 2.delete this var, it will delete the same var's type 3.can't choose var's type 添加重复项会导致严重的错误。重现步骤: 1.添加一个var,它具有相同的名称 2.删除这个var,它将删除相同的var类型 3.不能选择var的类型 image

I'll fix the bug later.稍后我会修复该错误。

Fixed with https://github.com/langgenius/dify/pull/5845/files