Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior after updating the name of a global variable #4191

Open
eric-schneider opened this issue Oct 17, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@eric-schneider
Copy link
Collaborator

eric-schneider commented Oct 17, 2024

Bug Description

After updating the name of a global variable (not its value), references to that global variable in existing projects exhibit inconsistent behavior depending on the type of field the variable is referenced in.

Reproduction

  1. Go to Settings > Global Variables and create a variable with name VARIABLE1 and some value. (Variable type doesn't matter; the bug affects both Generic and Credential type variables.)
  2. Create a new project and add an instance of the OpenAI model component.
  3. Add the VARIABLE1 global attribute to both the Input and OpenAI API Key fields.
  4. Go back to Settings > Global Variables and change the name from VARIABLE1 --> VARIABLE2.
  5. Go back to your project and inspect the component. Notice that the Input field still references VARIABLE1, and the OpenAI API Key field is empty.
  6. Navigate away from the project (e.g. go to the dashboard), and then go back to the project again. Notice that both fields are now empty.

Expected behavior

I expected one of two things to happen:

  1. Both fields to be empty.
    OR
  2. Both fields to update to the new name.

So the only thing I can concretely say is a bug is the old variable name sticking around in the Input field. However, I think serious consideration should be given to number 2. It doesn't make much sense to me that you're allowed to change the name of a global variable if that action removes it from all your existing projects. That's effectively the same behavior as deleting the global variable. (Though, I guess you could could make an argument that it still allows you to persist a secret within Langflow without having to re-add it.)

Who can help?

@anovazzi1, @Cristhianzl, @lucaseduoli

Operating System

macOS 14.7, Docker

Langflow Version

1.0.19

Python Version

3.11

Screenshot

inconsistent-global-variable-behavior.mp4

Flow File

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants