Skip to content

Conversation

@matejkubinec
Copy link
Collaborator

@matejkubinec matejkubinec commented Dec 19, 2025

}
}
const settings = await SettingsService.setSettings(args.body, args.token, true);
await thunkAPI.dispatch(fetchSettingsAction({ usedPassword: password, testEmail }));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SettingsUpdatedEvent is published even if fetchSettingsAction fails:

const settings = await SettingsService.setSettings(args.body, args.token, true);
await thunkAPI.dispatch(fetchSettingsAction({ usedPassword: password, testEmail }));
appEvents.publish(new SettingsUpdatedEvent()); // fires even if fetch fails

This means listeners will think settings were updated successfully even when they weren't. We should only publish the event if everything succeeds:

const settings = await SettingsService.setSettings(args.body, args.token, true);
const result = await thunkAPI.dispatch(fetchSettingsAction({ usedPassword: password, testEmail }));

if (result.type === fetchSettingsAction.fulfilled.type) {
appEvents.publish(new SettingsUpdatedEvent());
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual settings update is via setSettings so notifying the PMM UI about the changed even if the fetch on the Grafana side fails makes sense to me.

@matejkubinec matejkubinec merged commit 8f4518d into v3 Jan 14, 2026
2 of 3 checks passed
@matejkubinec matejkubinec deleted the PMM-14655-ui-syncing branch January 14, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants