Skip to content

Conversation

@reakaleek
Copy link
Member

@reakaleek reakaleek commented Jan 26, 2026

Problem

Users on the edge environment encountered this error when using Ask AI:

NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found

Root Cause

The zustand-indexeddb library hardcodes IndexedDB version to 1. When the code tried to create new object stores for conversation data, the database was already at version 1, so no upgradeneeded event fired and the stores were never created.

Solution

Replace zustand-indexeddb with idb-keyval:

  • Uses a simple key-value pattern (no object store/version management)
  • Leverages IndexedDB's native structured cloning (no JSON serialization)
  • Custom database name: elastic-docs-keyval-store
  • Namespaced keys: ask-ai/conversations-index, ask-ai/conversation-{id}

Other Changes

  • Moved aiProvider from index to per-conversation storage
  • Added MAX_CONVERSATIONS = 2 limit (temporary until UI supports multiple)
  • Simplified storage structure for extensibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants