Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: mute error notification when not needed (#7735)

Liu Jie0d55610c47c
diff --git a/frontend/src/store/modules/auth.ts b/frontend/src/store/modules/auth.ts
index 9594fc3086..a57d88e031 100644
--- a/frontend/src/store/modules/auth.ts
+++ b/frontend/src/store/modules/auth.ts
@@ -83,7 +83,8 @@ export const useAuthStore = defineStore("auth_v1", {
const userId = getIntCookie("user");
if (userId) {
const loggedInUser = await useUserStore().getOrFetchUserById(
- String(userId)
+ String(userId),
+ true // silent
);
this.currentUser = loggedInUser;
return loggedInUser;
@@ -92,7 +93,10 @@ export const useAuthStore = defineStore("auth_v1", {
},
async refreshUserIfNeeded(name: string) {
if (name === this.currentUser.name) {
- const refreshedUser = await useUserStore().fetchUser(name);
+ const refreshedUser = await useUserStore().fetchUser(
+ name,
+ true // silent
+ );
if (!isEqual(refreshedUser, this.currentUser)) {
this.currentUser = refreshedUser;
}
diff --git a/frontend/src/store/modules/user.ts b/frontend/src/store/modules/user.ts
index bcda69dc3e..f9454d5fcf 100644
--- a/frontend/src/store/modules/user.ts
+++ b/frontend/src/store/modules/user.ts
@@ -51,10 +51,15 @@ export const useUserStore = defineStore("user", {
}
return users;
},
- async fetchUser(name: string) {
- const user = await authServiceClient.getUser({
- name,
- });
+ async fetchUser(name: string, silent = false) {
+ const user = await authServiceClient.getUser(
+ {
+ name,
+ },
+ {
+ silent,
+ }
+ );
this.userMapByName.set(user.name, user);
return user;
},
@@ -75,20 +80,23 @@ export const useUserStore = defineStore("user", {
this.userMapByName.set(user.name, user);
return user;
},
- async getOrFetchUserByName(name: string) {
+ async getOrFetchUserByName(name: string, silent = false) {
const cachedData = this.userMapByName.get(name);
if (cachedData) {
return cachedData;
}
- const user = await this.fetchUser(name);
+ const user = await this.fetchUser(name, silent);
this.userMapByName.set(user.name, user);
return user;
},
getUserByName(name: string) {
return this.userMapByName.get(name);
},
- async getOrFetchUserById(uid: string) {
- return await this.getOrFetchUserByName(getUserNameWithUserId(uid));
+ async getOrFetchUserById(uid: string, silent = false) {
+ return await this.getOrFetchUserByName(
+ getUserNameWithUserId(uid),
+ silent
+ );
},
getUserById(uid: string) {
return this.userMapByName.get(getUserNameWithUserId(uid));