Mavenomics / MavenWorks

Agile Dashboarding, anywhere
https://mavenworks.com
GNU General Public License v3.0
18 stars 2 forks source link

Global Bindings can be broken by deleting and re-updating #75

Open quigleyj-mavenomics opened 4 years ago

quigleyj-mavenomics commented 4 years ago

Bindings are normally two-way- a change to one side of the binding will flow to the other. However, deleting and re-adding a global may break this.

(note- this repro is somewhat fragile- the "Any" type seems important)

  1. Create an empty dashboard
  2. Add a LabelPart, bind an option to a global "Foo"
  3. Create a global "Foo" with type Any and some value like "bar", and hit "Apply"

At this point, the LabelPart will still be in a "Fresh" state, which is wrong. It must be in an "Error" state, since the global it was bound to no longer exists. Continuing on...

  1. Delete the global and hit Apply.
  2. Create a new global "Foo" with type Any and a different value like "baz", and hit apply

At this point, the LabelPart won't update with the new value of Foo- likely because it was never checked to see if any missing globals could be bound, since it was still "fresh"

  1. Duplicate the LabelPart- observe that the duplicate is bound correctly
  2. Refresh the old/stale LabelPart and notice that the global updates, as does the other part
  3. Change the value of the global and notice that only the duplicated LabelPart updates

There's 3 bugs here but they may all have the same root cause: