fix(support): agent-demo self-seeds (join default queue + go online); tickets always get a queue
Root cause of 'waiting for escalations': no queue/membership meant tickets were never assigned. Now: createTicket find-or-creates a default queue; new joinDefault endpoint + useGoOnline hook; agent-demo joins+goes-AVAILABLE on load (assignPending picks up any waiting ticket). smoke-support self-seeds (no seed script needed). Also: vitest singleFork to end cross-file DB races (45 tests deterministic). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ export {
|
||||
useAssignedTickets,
|
||||
useCallbackRequest,
|
||||
useAvailability,
|
||||
useGoOnline,
|
||||
} from './react';
|
||||
// Re-export the chat hooks so a support app imports everything from one place.
|
||||
export { useThread, useMessages } from '@insignia/iios-message-web';
|
||||
|
||||
@@ -89,3 +89,12 @@ export function useAvailability(): (state: string) => Promise<unknown> {
|
||||
const client = useSupportClient();
|
||||
return (state) => client.setAvailability(state);
|
||||
}
|
||||
|
||||
/** Agent onboarding: join the default queue + go AVAILABLE (self-seed). */
|
||||
export function useGoOnline(): () => Promise<void> {
|
||||
const client = useSupportClient();
|
||||
return async () => {
|
||||
await client.joinDefaultQueue();
|
||||
await client.setAvailability('AVAILABLE');
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user