merlyn/server
Marcello Fitton 7ca2753c24
Sanitize Metadata Before PG Vector Database Insertion (#4434)
* Fix JSDOC for updateOrCreateCollection

* Add sanitizeForJsonb method to PGVector for safe JSONB handling

This new method recursively sanitizes values intended for JSONB storage, removing disallowed control characters and ensuring safe insertion into PostgreSQL. The method is integrated into the vector insertion process to sanitize metadata before database operations.

* Add unit tests for PGVector.sanitizeForJsonb method

This commit introduces a comprehensive test suite for the PGVector.sanitizeForJsonb method, ensuring it correctly handles various input types, including null, undefined, strings with disallowed control characters, objects, arrays, and Date objects. The tests verify that the method sanitizes inputs without mutating the original data structures.

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2025-09-29 13:49:45 -07:00
..
__tests__/utils Sanitize Metadata Before PG Vector Database Insertion (#4434) 2025-09-29 13:49:45 -07:00
endpoints Add User-Agent header on the requests sent by Generic OpenAI providers. (#4393) 2025-09-17 13:08:18 -07:00
jobs Workspace Chat with documents overhaul (#4261) 2025-08-11 09:26:19 -07:00
middleware Add HTTP request/response logging middleware for development mode (#4425) 2025-09-29 13:33:15 -07:00
models Add support for SIMPLE_SSO_NO_LOGIN_REDIRECT config setting (#4394) 2025-09-17 12:51:00 -07:00
prisma Workspace Chat with documents overhaul (#4261) 2025-08-11 09:26:19 -07:00
storage feat: Implement CometAPI integration for chat completions and model m… (#4379) 2025-09-16 14:38:49 -07:00
swagger patch folder name GET request response (#4395) 2025-09-17 13:05:11 -07:00
utils Sanitize Metadata Before PG Vector Database Insertion (#4434) 2025-09-29 13:49:45 -07:00
.env.example Add HTTP request/response logging middleware for development mode (#4425) 2025-09-29 13:33:15 -07:00
.flowconfig devcontainer v1 (#297) 2024-01-08 15:31:06 -08:00
.gitignore Workspace Chat with documents overhaul (#4261) 2025-08-11 09:26:19 -07:00
.nvmrc Implement Chroma Support (#1) 2023-06-07 21:31:35 -07:00
index.js Add HTTP request/response logging middleware for development mode (#4425) 2025-09-29 13:33:15 -07:00
jsconfig.json devcontainer v1 (#297) 2024-01-08 15:31:06 -08:00
nodemon.json Full developer api (#221) 2023-08-23 19:15:07 -07:00
package.json forgot 1.8.5 tag :) 2025-08-14 17:43:55 -07:00
yarn.lock Mobile sync support (#4173) 2025-07-31 12:28:03 -07:00