Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(web): retry user name/avatar fetch after a failed batch request (#5772)

Will Hutchinson446f74d24238
diff --git a/apps/web/src/lib/core/signal/profilePicture.ts b/apps/web/src/lib/core/signal/profilePicture.ts
index 0a227d3f0e..49f9c446b6 100644
--- a/apps/web/src/lib/core/signal/profilePicture.ts
+++ b/apps/web/src/lib/core/signal/profilePicture.ts
@@ -53,7 +53,14 @@ async function fetchProfilePictures(
});
if (result.isErr()) {
console.error('Failed to fetch user profile pictures');
- return [];
+ // Mark as not-loading with an expired timestamp so the next access
+ // retries the fetch instead of getting stuck forever (see
+ // `useProfilePictureUrl`'s `cacheExpired` check).
+ return ids.map((id) => ({
+ _createdAt: new Date(0),
+ id,
+ loading: false,
+ }));
}
const { pictures } = result.value;
diff --git a/apps/web/src/lib/core/user/displayName.ts b/apps/web/src/lib/core/user/displayName.ts
index ca266c7b4d..f2487a50c0 100644
--- a/apps/web/src/lib/core/user/displayName.ts
+++ b/apps/web/src/lib/core/user/displayName.ts
@@ -115,7 +115,14 @@ async function fetchDisplayNames(ids: string[]): Promise<UserNameItem[]> {
});
if (result.isErr()) {
console.error('Failed to fetch user display names');
- return [];
+ // Mark as not-loading with an expired timestamp so the next access
+ // retries the fetch instead of getting stuck showing the email
+ // fallback forever (see `ensureUserNameItem`'s `cacheExpired` check).
+ return ids.map((id) => ({
+ _createdAt: new Date(0),
+ id,
+ loading: false,
+ }));
}
const data = result.value;