Ui/primary/handle errors#8787
Conversation
| return this.get(`${mode}.state`); | ||
| } | ||
| const defaultDisp = 'Synced'; | ||
| const displays = { |
There was a problem hiding this comment.
you can see these values are now part of the CLUSTER_STATES map here: https://github.com/hashicorp/vault/pull/8787/files#diff-b8f0db91f050a7646bbb0d17521230a2R20
| }), | ||
|
|
||
| stateGlyph(state) { | ||
| const glyph = 'check-circle-outline'; |
There was a problem hiding this comment.
this is the default glyph to display, including when state is unknown. i let this be, but maybe we shouldn't show an icon at all if state can't be found?
| stateGlyph(state) { | ||
| const glyph = 'check-circle-outline'; | ||
|
|
||
| const glyphs = { |
There was a problem hiding this comment.
these are also now reflected in the CLUSTER_STATES map: https://github.com/hashicorp/vault/pull/8787/files#diff-b8f0db91f050a7646bbb0d17521230a2R20
| isSyncing: false, | ||
| }, | ||
| 'stream-wals': { | ||
| glyph: 'check-circle-outline', |
There was a problem hiding this comment.
i changed the glyph here to check-circle-outline instead of android-sync based off of conversations with bk that stream-wals is in fact the ideal syncing state.
| {{else if (eq mode 'performance')}} | ||
| {{cluster.perfReplicationStateDisplay}} | ||
| {{else}} | ||
| {{get (cluster-states modeState) "display"}} |
There was a problem hiding this comment.
i haven't been able to figure out where this code is actually executed -- if anyone has any ideas please lemme know! otherwise, if i can get rid of this line it means i can get rid of all of the 'display' properties inside CLUSTER_STATES
chelshaw
left a comment
There was a problem hiding this comment.
Great work! Love the state helper -- putting all of those in one place makes a ton of sense and seems to cover edge cases well. Will pull it down and play around with it, but so far looks great!
| if (title === 'States') { | ||
| const currentClusterisOk = clusterStates([state]).isOk; | ||
| const primaryIsOk = clusterStates([connection]).isOk; | ||
| return !(currentClusterisOk && primaryIsOk); |
|
I ended up in a bad git state, so moving this PR here: #8845 |
Handle Errors & Display cluster states consistently
Summary of changes
clusterStateshelper to help with aforementioned consistency**drStateDisplaywith this new helperstream-walsto display an check circle icon instead of a sync iconExamples
Error state for a DR primary
Status menu on a DR primary, when cluster is in a good state
Status menu on a DR Secondary, when cluster itself is in a good state but the connection_state is bad
Questions / Feedback
connection_state. This means that if a secondary is OK, but it's connection state is bad, we still show the status menu as "green" (see example above). The dashboard will show an error, however. I left this be for now because changing the logic of the status menu seemed like a big undertaking but I'm open to ideas.defaultDisplayinsidecluster-states.jsin case there are other states that we're not aware of. i don't love this solution because it seems like we should be aware of all possible cluster states, but it seemed better than blowing up the app if one couldn't be found.TODO / known issues