You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chat API is now async (mutation + polling): queryKnowledgeBase moved from Query to Mutation. Returns immediately with PENDING status. Clients must poll getConversation for results. The old synchronous query no longer exists. All consumers must redeploy their backend stack.
conversationId and requestId must be UUID v4: The backend validates both IDs. Non-UUID conversation IDs stored in localStorage from previous versions are automatically regenerated by the web component. Custom conversationId props that aren't valid UUIDs are silently replaced (with a console warning).
ChatResponse type removed from schema: Replaced by ChatRequest (mutation response) and ConversationTurn (within Conversation type).
Added
Async chat pattern: queryKnowledgeBase mutation writes a PENDING record to DynamoDB, async-invokes QueryKBFunction, and returns immediately. Bypasses AppSync's 30-second resolver timeout for Bedrock Converse API calls that take 30-50s.
getConversation query: Returns all turns for a conversation from DynamoDB. Used by the client for polling and will support future conversation listing/search.
New schema types: ChatRequest, ChatStatus, ConversationTurn, Conversation.
Polling with step backoff: Client polls at 1s initial interval, 1.5x growth, 5s cap. Progressive timeout UX: 30s "taking longer than usual" indicator, 90s hard timeout.
AbortController support: Polling cancels on component unmount or new message send. In-flight fetch requests are aborted via AbortSignal.
User-scoped conversations: userId persisted on conversation turns. getConversation denies access when the turn's userId doesn't match the requester (or requester is unauthenticated).
Conversation ID validation: Web component validates localStorage and prop values, auto-regenerates invalid (non-UUID) IDs with console warning.
Fixed
Race condition in turn number assignment: Concurrent requests could assign the same turnNumber. Now uses conditional put_item with attribute_not_exists(turnNumber) and retry on conflict.
PENDING turns contaminate LLM context: get_conversation_history now filters out PENDING turns so in-progress requests don't inject empty assistant responses into the Bedrock Converse context.
Orphaned PENDING records: If async Lambda invoke fails after writing the PENDING record, the record is cleaned up via delete_item.