mirror of
https://github.com/immich-app/yucca.git
synced 2026-09-30 21:37:50 +08:00
fix(futo-backups-bot): fall back to a generic agent name when the profile read is forbidden (#584)
This commit is contained in:
@@ -139,8 +139,10 @@ export class FreshdeskRepository {
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const response = await this.request('GET', `/api/v2/agents/${agentId}`, undefined, [404]);
|
||||
const name = response.status === 404 ? 'Support' : agentSchema.parse(await response.json()).contact.name;
|
||||
// Reading other agents' profiles needs privileges the group-scoped bot
|
||||
// key does not have — 403 falls back like 404 instead of failing ingest.
|
||||
const response = await this.request('GET', `/api/v2/agents/${agentId}`, undefined, [403, 404]);
|
||||
const name = response.ok ? agentSchema.parse(await response.json()).contact.name : 'Support';
|
||||
this.agentNames.set(agentId, name);
|
||||
return name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user