fix: filter out system inboxes (*, user) from team member list
The broadcast inbox file (inboxes/*.json) was being parsed by listInboxNames() as a member named "*", which appeared in the UI as a phantom team member. Since "*" fails the MEMBER_NAME_PATTERN validation, it could not be removed through the UI. Filter system inbox names (*, user) from listInboxNames() so they are not treated as real team members.
This commit is contained in:
parent
7ff9317b6f
commit
fdc49f475e
1 changed files with 6 additions and 1 deletions
|
|
@ -42,9 +42,14 @@ export class TeamInboxReader {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exclude broadcast inbox (*.json) and user inbox (user.json) — these are
|
||||||
|
// system inboxes, not real team members. Without this filter, '*' appears
|
||||||
|
// as a phantom member in the UI that can't be removed.
|
||||||
|
const SYSTEM_INBOX_NAMES = new Set(['*', 'user']);
|
||||||
return entries
|
return entries
|
||||||
.filter((name) => name.endsWith('.json') && !name.startsWith('.'))
|
.filter((name) => name.endsWith('.json') && !name.startsWith('.'))
|
||||||
.map((name) => name.replace(/\.json$/, ''));
|
.map((name) => name.replace(/\.json$/, ''))
|
||||||
|
.filter((name) => !SYSTEM_INBOX_NAMES.has(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMessagesFor(teamName: string, member: string): Promise<InboxMessage[]> {
|
async getMessagesFor(teamName: string, member: string): Promise<InboxMessage[]> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue