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:
Artem Rootman 2026-04-05 16:38:09 +00:00
parent 7ff9317b6f
commit fdc49f475e
No known key found for this signature in database
GPG key ID: B7C30676209A822C

View file

@ -42,9 +42,14 @@ export class TeamInboxReader {
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
.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[]> {