merlyn/server/utils
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
..
agentFlows Implement importing of agent flows from community hub (#3867) 2025-06-05 15:08:58 -07:00
agents Refactor Class Name Logging (#4426) 2025-09-25 15:34:19 -10:00
AiProviders Enable custom HTTP response timeout for ollama (#4448) 2025-09-29 12:32:55 -07:00
BackgroundWorkers Workspace Chat with documents overhaul (#4261) 2025-08-11 09:26:19 -07:00
boot Fix Typos in MetaGenerator.js Documentation Comments (#3993) 2025-06-13 08:56:40 -07:00
chats Report sources in API responses on finalized chunk (#4396) 2025-09-17 15:16:35 -07:00
collectorApi Allow user to specify args for chromium process so they dont need SYS_ADMIN on container. (#4397) 2025-09-17 16:31:08 -07:00
comKey [BETA] Live document sync (#1719) 2024-06-21 13:38:50 -07:00
database Prune telemetry events 2025-04-29 13:54:00 -07:00
DocumentManager Enable ability to do full-text query on documents (#758) 2024-02-21 13:15:45 -08:00
EmbeddingEngines Refactor Class Name Logging (#4426) 2025-09-25 15:34:19 -10:00
EmbeddingRerankers/native Patch tokenizer race condition bug (#4091) 2025-07-07 13:25:30 -07:00
EncryptionManager [BETA] Live document sync (#1719) 2024-06-21 13:38:50 -07:00
files patch folder name GET request response (#4395) 2025-09-17 13:05:11 -07:00
helpers Enable custom HTTP response timeout for ollama (#4448) 2025-09-29 12:32:55 -07:00
http Mobile sync support (#4173) 2025-07-31 12:28:03 -07:00
logger patch logger for full logs 2024-07-19 18:35:41 -07:00
MCP Refactor Class Name Logging (#4426) 2025-09-25 15:34:19 -10:00
middleware Flag to disable login UI and endpoints for credentialed auth (#3984) 2025-06-11 12:46:40 -07:00
PasswordRecovery Strengthen field validations on user Updates (#1201) 2024-04-26 16:46:04 -07:00
prisma Fix Typos in Comments and Documentation (#3987) 2025-06-12 13:59:38 -07:00
telemetry Prune telemetry events 2025-04-29 13:54:00 -07:00
TextSplitter Native Embedder model selection (incl: Multilingual support) (#3835) 2025-07-22 10:07:20 -07:00
TextToSpeech Add model field parameter for generic OpenAI TTS (#4171) 2025-07-17 10:28:51 -07:00
vectorDbProviders Sanitize Metadata Before PG Vector Database Insertion (#4434) 2025-09-29 13:49:45 -07:00
vectorStore PGvector vector database support (#3788) 2025-05-09 12:27:11 -07:00