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

Refactor code to use composition API #5860

Closed
akhenry opened this issue Oct 10, 2022 · 2 comments · Fixed by #5941
Closed

Refactor code to use composition API #5860

akhenry opened this issue Oct 10, 2022 · 2 comments · Fixed by #5941

Comments

@akhenry
Copy link
Contributor

akhenry commented Oct 10, 2022

Summary

There are several instances in our codebase where domain object composition is being changed by directly mutating the composition property of domain objects. This is problematic for two reasons:

  1. It will not trigger composition listeners.
  2. It will not work at all with anything other than the default composition provider.

We see a lot of bugs that are some version of "removing an object from X does not update Y". This issue may underlie a lot of these kinds of issues that keep coming up. There was legacy code that used to plaster over this issue by automatically detecting composition changes in object mutation in order to bridge the legacy and current APIs, but this code has been removed along with the legacy codebase.

Expected vs Current Behavior

Object composition operations should always use the composition API.

@ozyx
Copy link
Contributor

ozyx commented Nov 10, 2022

Testing Notes

Test composition in general:

  1. Add / Remove objects to / from composition-able objects (particular focus on scatter plots, gauge, display layout, and flexible layout)
  2. Add / Remove objects to/ from composition-able objects using the RemoveAction (selecting 'Remove' from the right-click context menu in the object tree or elsewhere)
  3. Verify the composition is correct after save by calling this.openmct.composition.get(domainObject) in console

@unlikelyzero
Copy link
Contributor

Verified

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

Successfully merging a pull request may close this issue.

4 participants