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

Keep general state from becoming stale #148

Open
Caleb-Ellis opened this issue Aug 23, 2019 · 7 comments
Open

Keep general state from becoming stale #148

Caleb-Ellis opened this issue Aug 23, 2019 · 7 comments

Comments

@Caleb-Ellis
Copy link
Contributor

Caleb-Ellis commented Aug 23, 2019

Relevant PR comments: #133 (review)

At the moment, general data is only fetchable and in many cases its in some way derived from config state. We need a way to re-fetch general state whenever config is synced (UPDATE_CONFIG_NOTIFY).

@squidsoup
Copy link
Contributor

@Caleb-Ellis can you provide an example of where this is an issue in the app please?

@Caleb-Ellis
Copy link
Contributor Author

@squidsoup It's not currently a huge issue, and I imagine it's only going to affect MAASes with more than one person using it at a time. Basically there are a few fields in state.general that are derived from elsewhere in state, however it itself isn't updated when any of those other state objects are updated.

I became aware of it in the above PR where you can update the default OS/release for deploying machines. The list of OSes and releases you can select are fetched from state.general but when you save the form what you're actually saving is state.config. And since state.general isn't refetched when state.config is saved you can have a discrepancy between values.

e.g. if you changed the default OS/Release from Bionic to Xenial, you would have in state:

state: {
  general: {
    osInfo: {
      default_osystem: "ubuntu",
      default_distro_series: "bionic"
      ...
    }
    ...
  },
  config: {
    items: [
      {
        name: "default_osystem",
        value: "ubuntu"
      },
      {
        name: "default_distro_series",
        value: "xenial"
      },
      ...
    ]
    ...
  }
  ...
}

...until you explicitly fetch state.general.osInfo again, by refreshing or navigating to a page that does it or whatever. So yeah. not a huge issue but it feels wrong to have things in the state object that aren't true.

@huwshimi
Copy link
Contributor

It looks like we get 'config' sync messages but not 'general' when these values change. We can either implement some kind of mapping between these on our end or request changes to the ws api.

@squidsoup
Copy link
Contributor

squidsoup commented Nov 11, 2019 via email

@huwshimi
Copy link
Contributor

The change would just be to add the normal sync/update message that other models get when they change.

@huwshimi
Copy link
Contributor

huwshimi commented Nov 8, 2021

I couldn't find a Launchpad bug for this so I filed one: https://bugs.launchpad.net/maas/+bug/1950106.

@Caleb-Ellis
Copy link
Contributor Author

Caleb-Ellis commented May 12, 2022

Still valid. It's the root cause for a couple of other LP bugs too (that I can't quite remember). Adding a blocked label as essentially this requires a backend fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants