Skip to content

Commit cadcb42

Browse files
update progress document
1 parent e69f294 commit cadcb42

1 file changed

Lines changed: 27 additions & 11 deletions

File tree

SOLID_INTEGRATION_PROGRESS.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Successfully implemented Solid Pod storage integration for LibreChat, enabling u
8686
- Added fallback mechanism for schema validation failures
8787
- Extracts `model` and `endpoint` from messages when missing in conversation metadata
8888
- Ensures `resendFiles` is included in payloads for agents endpoints (defaults to `true`)
89-
- Fixed model extraction in `buildEndpointOption` middleware to load from Solid when missing
89+
- **buildEndpointOption** (per PR review): Uses storage-agnostic `getConvo(req.user.id, conversationId, req)` to fill missing model; no Solid-specific logic in that middleware—storage is chosen in the model layer
9090

9191
### 10. Full Conversation Flow
9292
- **Status**: Complete
@@ -100,9 +100,9 @@ Successfully implemented Solid Pod storage integration for LibreChat, enabling u
100100
- **Status**: Complete
101101
- **Details**:
102102
- Conversation titles are properly saved to Solid Pod when generated
103-
- Titles persist correctly after page refresh
103+
- Titles persist correctly after page refresh and after sending more messages
104104
- `saveConvo` correctly identifies Solid users before saving to Solid Pod
105-
- `saveConvoToSolid` merges updates with existing conversation data to prevent data loss
105+
- **saveConvoToSolid** merges existing Pod conversation into the incoming document before writing, so partial updates (e.g. after POST message or BaseClient saveConvo) preserve fields like `title` instead of overwriting the file and losing the generated title
106106

107107
### 12. Conversation Management Operations
108108
- **Status**: Complete
@@ -124,6 +124,21 @@ Successfully implemented Solid Pod storage integration for LibreChat, enabling u
124124
- Fetches shared messages directly from Pod using unauthenticated requests
125125
- Properly removes public access when share is deleted
126126

127+
### 14. Schema-Aligned Document Content (PR Review)
128+
- **Status**: Complete
129+
- **Details**:
130+
- **Single source of document shape**: JSON written to the Solid Pod now matches the same document shape as MongoDB; shape is defined in the model layer and aligned with `packages/data-schemas` (message + convo schema and types).
131+
- **Messages**: `Message.js` builds the full message document (including `user`, `createdAt`, `updatedAt`) and passes it to `saveMessageToSolid`. SolidStorage only validates ids, resolves paths, and writes that document; the previous hand-built field list and defaults in SolidStorage were removed.
132+
- **Conversations**: `Conversation.js` builds the full conversation document (conversationId, user, …convo, expiredAt, `previousConversationId` when renaming) and passes it to `saveConvoToSolid`. SolidStorage only adds Pod-specific data (message refs from the Pod, timestamps, optional model/endpoint fallback from messages), then merges with existing Pod conversation (to preserve e.g. title on partial updates) and writes. It no longer constructs the conversation payload from a custom field list.
133+
- **Partial updates**: When the caller sends a partial update (e.g. after sending a message with no `title`), existing conversation from the Pod is merged into the incoming document before writing so fields like `title` are preserved.
134+
135+
### 15. PR Review: Config, Logging, Convos
136+
- **Status**: Complete
137+
- **Details**:
138+
- **config.js**: `openidLoginEnabled` set to `isOpenIdEnabled` only (removed `|| isSolidEnabled`) so when only Solid is enabled the login page shows one Solid button, not both OpenID and Solid.
139+
- **requireJwtAuth.js**: Removed non–Solid-specific debug logging added during auth flow debugging; reviewer suggested upstreaming useful logging in a separate PR if needed.
140+
- **convos.js**: No code change; reviewer concern addressed by clarification—`getConvo(req.user.id, conversationId, req)` in `Conversation.js` already branches on `isSolidUser(req)` and uses Solid when the user is a Solid user.
141+
127142
## Current Status
128143

129144
### Working Features
@@ -196,22 +211,23 @@ None currently identified.
196211

197212

198213
## Files Modified
199-
- `api/server/services/SolidStorage.js` (NEW) - Core Solid Pod operations
214+
- `api/server/services/SolidStorage.js` (NEW) - Core Solid Pod operations; schema-aligned: accepts full document from model layer, only adds message refs + timestamps + merge with existing for partial updates (no custom document content)
200215
- `api/server/utils/isSolidUser.js` (NEW) - Shared helper to detect Solid login (`provider === 'solid'`), used across models, routes, and middleware (DRY)
201-
- `api/models/Message.js` - Integrated Solid storage; MongoDB path for non-Solid users only (no fallback for Solid)
202-
- `api/models/Conversation.js` - Integrated Solid storage; no MongoDB fallback for Solid users (return null/rethrow on Solid failure)
216+
- `api/models/Message.js` - Integrated Solid storage; builds full message document (user, createdAt, updatedAt) and passes to SolidStorage; MongoDB path for non-Solid users only (no fallback for Solid)
217+
- `api/models/Conversation.js` - Integrated Solid storage; builds full conversation document and passes to SolidStorage; no MongoDB fallback for Solid users (return null/rethrow on Solid failure); passes `previousConversationId` when renaming
203218
- `api/server/routes/oauth.js` - Token logging and storage
204219
- `api/server/services/AuthService.js` - Token management
205220
- `api/server/index.js` - Session middleware ordering
206221
- `api/server/controllers/AuthController.js` - Refresh token handling
207222
- `api/server/middleware/validate/convoAccess.js` - Added Solid storage support for conversation access validation
208-
- `api/server/middleware/buildEndpointOption.js` - Added model extraction from Solid storage when missing; uses shared `isSolidUser`
223+
- `api/server/middleware/buildEndpointOption.js` - Uses storage-agnostic `getConvo(req.user.id, conversationId, req)` to fill missing model (no Solid-specific logic)
209224
- `api/server/middleware/validateMessageReq.js` - Solid storage validation; no MongoDB fallback for Solid users (404 on Solid failure)
225+
- `api/server/middleware/requireJwtAuth.js` - Removed debug auth logging (per PR review)
226+
- `api/server/routes/config.js` - `openidLoginEnabled: isOpenIdEnabled` only so Solid-only shows one button (per PR review)
210227
- `api/server/routes/messages.js` - Solid message reads return 503 on Solid failure (no MongoDB fallback)
211228
- `api/server/services/Endpoints/agents/initialize.js` - Enhanced model discovery from request body and endpointOption
212229
- `packages/data-provider/src/createPayload.ts` - Added normalization for Solid conversation objects and fallback handling
213-
- `api/models/Conversation.js` - Fixed `saveConvo` to check for Solid users before saving to Solid Pod, added Solid storage support to `deleteConvos`
214-
- `api/server/services/SolidStorage.js` - Enhanced `saveConvoToSolid` to merge updates with existing conversation data, improved message deletion logging
230+
- `api/server/services/SolidStorage.js` - Schema-aligned: `saveMessageToSolid` accepts full message document; `saveConvoToSolid` accepts full convo document, merges with existing Pod conversation to preserve title (and other fields) on partial updates
215231
- `api/server/utils/import/fork.js` - Added Solid storage support to `duplicateConversation` function
216232
- `api/server/routes/convos.js` - Updated duplicate and delete endpoints to pass `req` for Solid storage support
217233
- `api/server/services/SolidStorage.js` - Added `isArchived` field support in `saveConvoToSolid` and `getConvosByCursorFromSolid` for archive functionality
@@ -267,11 +283,11 @@ The following environment variables are used for the generic "Login with OpenID"
267283
- Storage is chosen per user: **Solid Pod** for users who logged in with "Continue with Solid" (`provider === 'solid'`); **MongoDB** for everyone else. No environment variable is required.
268284

269285
### Imports (top-level vs inline)
270-
- **API code** (Conversation.js, Message.js, buildEndpointOption.js, validateMessageReq.js, messages.js, convos.js, fork.js): SolidStorage and isSolidUser are required at **top level** for clarity and tooling (per PR review).
286+
- **API code** (Conversation.js, Message.js, buildEndpointOption.js, validateMessageReq.js, messages.js, convos.js, fork.js): SolidStorage and isSolidUser are required at **top level** for clarity and tooling (per PR review). buildEndpointOption.js now uses only `getConvo` from `~/models` (no SolidStorage/isSolidUser).
271287
- **packages/data-schemas share.ts**: SolidStorage and isSolidUser use **inline** `require()` inside the functions that need them, to avoid a circular dependency (data-schemas ← SolidStorage ← data-schemas for `logger`). Top-level require there caused `logger` to be undefined at load time and backend crash.
272288

273289
---
274290

275-
**Report Date**: February 11, 2026
291+
**Report Date**: February 10, 2026
276292

277293

0 commit comments

Comments
 (0)