BluePeriod Docs
開発トラブルシューティング

Troubleshooting: Firefox Sync Discrepancy

Firefox環境での同期時データ表示不整合の原因と対処法

Troubleshooting: Firefox Sync Discrepancy

Issue

In Firefox, after a "Clear Local Database" followed by a "Restore" (Sync Download), the global data (AI Characters, Chat Prompts) may appear missing in the UI (e.g., "chat.noCharacter" labels), even though the data has been correctly downloaded and inserted into IndexedDB.

Root Cause

This appears to be a race condition or state staleness issue specific to Firefox's handling of IndexedDB transactions relative to React/Jotai state updates.

  • The importGlobalChunk function clears and repopulates the characters table.
  • However, the in-memory Jotai atoms (charactersAtom) do not always detect this change immediately or receive the updated data list upon the subsequent loadCharactersAtom call.

Current Workaround

The system now explicitly triggers a reload of all relevant atoms (loadCharactersAtom, loadChatSessionsAtom, loadProjectAtom) immediately after the sync process completes (syncAtoms.ts).

Debugging Steps

If this issue resurfaces:

  1. Open DevTools -> Application -> Storage -> IndexedDB. Verify if the characters table actually contains data.
  2. If data exists in DB but not UI, a page reload (F5) should fix it.
  3. Check syncAtoms.ts to ensure the explicit reload logic is executing.

On this page