Improve Modal Error
Scenario: "When on click and goes offline, it displays error"
- Open MR modal
- Network > Offline
| Video | Error |
|---|---|
| offline-error | ![]() |
Recommendation
a. Display error on the Modal instead on the page which is behind the modal
OR
b. Close modal when there is an error and keep existing error on the web page
The "Real" Problem
After more investigation on this matter, turns out we have a race condition problem. The modal error message is being reset; hence, the error message is not being displayed.
async handleClick() {
this.isResolving = true;
if (!this.vulnerabilityId) {
await this.createVulnerabilityForFinding();
}
this.$emit('resolveStart');
this.startResolveWithAISubscription();
},
The scenario is difficult to replicate consistently as it really depends on the timing between the error response and the resolveStart event.
Scenario one: No error message is displayed (the bug)
createVulnerabilityForFinding returns error response
└──────────▶|
resolveStart resets error message to ''
└──────────────────────▶|
Result: No error message b/c '' wins
Scenario two: Error message is displayed
createVulnerabilityForFinding returns error response
└──────────────────────▶|
resolveStart resets error message to ''
└──────────▶|
Result: Display Error message
Here's example of the error message working: #509284 (comment 2267320731)
Edited by Samantha Ming
