Skip to content

Server-only storage: remove IndexedDB entirely#68

Merged
flocom merged 1 commit into
mainfrom
claude/elegant-dijkstra-5pz84f
Jun 10, 2026
Merged

Server-only storage: remove IndexedDB entirely#68
flocom merged 1 commit into
mainfrom
claude/elegant-dijkstra-5pz84f

Conversation

@flocom

@flocom flocom commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Policy (user requirement)

"C'est soit sur le serveur soit ça ne l'est pas du tout." IndexedDB is removed entirely: the MCP server's disk is the one and only project store. The browser keeps the open project in memory, pushes every change, and persists nothing project-related (only the current-project id in localStorage). Net −225 lines.

What changed

  • Deleted: openDatabase, the projects/meta IndexedDB stores, idbGet/Put/DeleteProject, idbGet/PutMeta, refifyForIdb (no local records to compact), persistCommittedRev (revisions live in memory). The legacy database is deleted at startup (one-time cleanup of existing browsers).
  • loadState(injectedRecord?): fetches the open project from the server — or uses the record reloadProjectFromServer already fetched (no double download). Stale-token guard preserved.
  • syncWithRemote() = "load the list from the only store": the server list replaces the in-memory list. Session-only projects survive only while the editor holds content or work is queued (their next save creates them server-side). Client tombstone handling is gone — with no cache there is nothing to resurrect (server endpoint stays).
  • Push retry rebuilds from the live editor state for the open project; background pushes re-use their snapshot.
  • duplicate / backup export / backup import all go through the server. Duplication shares the content-addressed blobs — zero image bytes travel. Legacy IndexedDB dumps import project-by-project to the server.
  • SSE deleted: the project disappears from the list live; if it was open, the editor switches away (server truth, applied instantly).
  • Pending-upload ledger is in-memory — the blocking upload overlay (Remove "cache local" from the UI + blocking upload overlay until server confirmation #67) + beforeunload warning cover the tab-close window; uploads still re-apply on any server-wins reload until confirmed.
  • No server configured → explicit "Aucun serveur configuré — rien ne sera enregistré" (session-only editing + PNG exports still work).
  • CLAUDE.md updated to the server-only architecture.

Verified

Syntax checks on all JS, zero remaining references to any removed identifier or bare db, critical flows walked (init / switch / create / duplicate / delete / SSE deleted / retry baseRev after switch), assets serve.

https://claude.ai/code/session_01Q5Cd4M127ug84nhGjkiyLe


Generated by Claude Code

"C'est soit sur le serveur soit ça ne l'est pas du tout": projects now live
exclusively on the MCP server's disk. The browser holds the open project in
memory and pushes every change; nothing project-related persists browser-side
anymore (only the current-project id, in localStorage). Net: -225 lines.

- Deleted: openDatabase, the projects/meta IndexedDB stores, idbGet/Put/Delete
  helpers, refifyForIdb (records no longer stored locally), persistCommittedRev
  (rev lives in memory: currentProjectRev/remoteRev). The legacy database is
  deleted at startup (one-time cleanup).
- loadState(injectedRecord?) fetches the open project from the server (or uses
  the record reloadProjectFromServer already fetched — no double download).
  The stale-token guard is preserved.
- syncWithRemote() is now just "load the list from the only store": server list
  replaces the in-memory list; session-only projects are kept only while the
  editor holds content for them or work is queued (their next save creates them
  server-side). Client-side tombstone handling is gone — without a cache there
  is nothing to resurrect (the server endpoint stays).
- Push-retry rebuilds from the live editor state (saveState) for the open
  project, or re-uses the snapshot for background pushes.
- duplicateProject / backup export / backup import all go through the server
  (duplicate shares content-addressed blobs — no image bytes travel). Legacy
  full-IndexedDB dumps import each project record to the server.
- SSE "deleted" now removes the project from the list live, switching away if
  it was open (server truth, applied instantly).
- Pending-upload ledger is in-memory (the blocking upload overlay + beforeunload
  warning cover the tab-close window).
- No server configured → explicit "Aucun serveur configuré — rien ne sera
  enregistré" (the editor still works for the session, exports stay possible).
- CLAUDE.md updated to describe the server-only architecture.

https://claude.ai/code/session_01Q5Cd4M127ug84nhGjkiyLe
@flocom
flocom merged commit 453aa41 into main Jun 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants