Update basic data after installation (#2657)

# What this PR does
Adding additional `UpdateBasicData` after installation, to handle that
case
1. Plugin calls `UpdateBasicData` in parallel to `setupPlugin` which
handles sync/install
2. If plugin is not installed, `UpdateBasicData` from step 1 will fail
with 403s

## Which issue(s) this PR fixes

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
This commit is contained in:
Ildar Iskhakov 2023-07-27 17:42:11 +08:00 committed by GitHub
parent d1be11ce32
commit 8fbd00f00f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -103,7 +103,6 @@ export const Root = observer((props: AppRootProps) => {
const updateBasicData = async () => {
await store.updateBasicData();
await store.alertGroupStore.fetchIRMPlan();
};
const location = useLocation();

View file

@ -125,6 +125,7 @@ export class RootBaseStore {
this.escalationPolicyStore.updateWebEscalationPolicyOptions(),
this.escalationPolicyStore.updateEscalationPolicyOptions(),
this.escalationPolicyStore.updateNumMinutesInWindowOptions(),
this.alertGroupStore.fetchIRMPlan(),
]);
}
@ -198,6 +199,7 @@ export class RootBaseStore {
* therefore there is no need to trigger an additional/separate sync, nor poll a status
*/
await PluginState.installPlugin();
this.updateBasicData();
} catch (e) {
return this.setupPluginError(
PluginState.getHumanReadableErrorFromOnCallError(e, this.onCallApiUrl, 'install')