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

[BUG] - Active build isn't updated in the UI until environment tab is closed #334

Open
kcpevey opened this issue Nov 9, 2023 · 6 comments
Assignees
Labels
needs: investigation 🔎 This issue needs more investigation before making a decision type: bug 🐛 Something isn't working

Comments

@kcpevey
Copy link
Contributor

kcpevey commented Nov 9, 2023

Describe the bug

When you specify a new active build, some parts of the UI don't update until the environment tab is closed.

Expected behavior

I expect the UI to update views when I make changes.

How to Reproduce the problem?

  • Create an environment ENV1 which succeeds in building
  • Create another successful build of ENV1
  • Open a different environment tab
  • Open the environment tab to view the environment, note which build is Active
  • Go to Edit
  • Click on the non-active build
  • Click "update environment build"
  • Observe that the Build dropdown now says the one we selected is "Active" - this is good.
  • Click on a different environment tab
  • Click back on the ENV1 tab
  • Observe that the build that we just selected as "Active" is no longer listed as "Active" - that can't be right...
  • Close the tab for ENV1
  • Open the tab for ENV1
  • Observe that the Active build IS properly specified after all... the UI just didn't update properly.

I believe #333 is related in that I think they both are rooted in there not being a "state" for the interface. Also similar to #333 this feels very trivial and edge case, but because there are several issues like this, it makes users feel like they might be losing their mind when they are trying to debug builds 😹 .

Output

No response

Versions and dependencies used.

No response

Anything else?

No response

@kcpevey kcpevey added type: bug 🐛 Something isn't working status: blocked ⛔️ needs: investigation 🔎 This issue needs more investigation before making a decision and removed status: blocked ⛔️ labels Nov 9, 2023
@kcpevey
Copy link
Contributor Author

kcpevey commented Nov 9, 2023

Adding the investigation label since I just realized this deployment is using an older version of the UI. I'll need to retest this on a new deployment.

@trallard
Copy link
Collaborator

@kcpevey did you manage to confirm repro of this issue?

@kcpevey
Copy link
Contributor Author

kcpevey commented Nov 21, 2023

I was waiting for a deployment to test on since I moved machines, I dont have it set up locally. I'll either have to get this set up locally or wait for our internal deployment to include the latest conda-store release. I won't have time for a local setup this week, but I can check back next week.

@kcpevey
Copy link
Contributor Author

kcpevey commented Jan 30, 2024

This is still happening in 2024.1.1rc. Its definitely not behaving properly.

@gabalafou
Copy link
Contributor

As I see it, the underlying issue for both #333 and this issue is that the front-end's global (Redux) store does not really support multiple forms open at the same time. If I had to guess, I would guess that the tabs functionality (i.e., being able to open multiple environments at once across different tabs) was added to the front-end app later. (However, a cursory glance at the git history does not seem to support this guess. Compare the PageTabs commit history with SpecificationEdit commit history, for example.)

In other words, the state object looks roughly like this:

type GlobalState = {
  tabs: {
    // The environments which have been opened (they each have their own tab)
    selectedEnvironments: Environment[]; 
    // The environment in the active tab
    selectedEnvironment: Environment || null;
  };
  // The list of channels for the currently selected environment.
  // This list gets updated as the user edits the form, and it 
  // gets completely replaced each time the user switches tabs.
  channels: string[];
};

This means that we store info like the environment name for each tab, but we only have one place where we store the form data for each tab, so each time a tab is switched, it loads that space with new data for the active tab, obliterating whatever the state was for the previously open tab.

So what we need is something like a dictionary of edits keyed by environment id:

type GlobalState = {
  tabs: { /* ... */ };
  environmentForms: {
    [envId: string]: {
      channels: string[];
    }
  };
};

@gabalafou
Copy link
Contributor

Did #389 fix this?

@trallard trallard removed the project: JATIC Work item needed for the JATIC project label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: investigation 🔎 This issue needs more investigation before making a decision type: bug 🐛 Something isn't working
Projects
Status: TODO 📬
Development

No branches or pull requests

3 participants