release: dev → main — pgserve auth + tsvector QA fix#52
Conversation
Two bugs found during QA with 26MB JSONL: 1. pgserve uses password auth (default: postgres/postgres) but the connection string had no credentials. Fix: add user:pass to URI. 2. PostgreSQL tsvector has a 1MB input limit. JSONL lines >1MB caused "string is too long for tsvector" error. Fix: use left(content, 500000) in the GENERATED column to cap tsvector input at 500K chars.
fix(storage): pgserve auth credentials + tsvector size limit
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughVersion bump to 0.260331.2 across package metadata. Storage layer updated to truncate content to 500,000 characters for full-text search indexing and connection string modified to use explicit PostgreSQL credentials with IP address instead of localhost. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request increments the package version and introduces a truncation limit of 500,000 characters for full-text search indexing to prevent errors with large content. It also updates the database connection string to use explicit credentials and a loopback IP address. Review feedback points out that the schema change will not be applied to existing installations due to the 'IF NOT EXISTS' clause and identifies a security risk regarding the hardcoded database credentials.
| session_id TEXT, | ||
| content TEXT NOT NULL, | ||
| content_tsvector TSVECTOR GENERATED ALWAYS AS (to_tsvector('english', content)) STORED | ||
| content_tsvector TSVECTOR GENERATED ALWAYS AS (to_tsvector('english', left(content, 500000))) STORED |
There was a problem hiding this comment.
The CREATE TABLE IF NOT EXISTS statement (line 26) will not update the schema for users who already have the records table initialized (e.g., in persistent mode). Consequently, the content_tsvector column will retain its old definition without the left() truncation, and ingestion of large content will still fail. Since ingest() already truncates this table, you might consider ensuring the schema is updated by dropping and recreating the column or the table during the initialization phase.
| /** Connection string for the running pgserve instance */ | ||
| get connectionString(): string { | ||
| return `postgresql://localhost:${this.port}/${RLMX_DB}`; | ||
| return `postgresql://postgres:postgres@127.0.0.1:${this.port}/${RLMX_DB}`; |
There was a problem hiding this comment.
Summary
Hotfix release: two bugs found during QA of the pgserve storage feature.
Fixes (PR #51)
postgres:postgrescredentials — pgserve uses password auth by defaultleft(content, 500000)in the GENERATED column.QA Evidence
pg_search()returns results from large contextSummary by CodeRabbit