Skip to content

fix: enforce read-only SQLite connections - #61

Merged
Microck merged 1 commit into
masterfrom
fix/sqlite-read-only
Oct 24, 2026
Merged

Microck merged 1 commit into
masterfrom
fix/sqlite-read-only

Conversation

@Microck

@Microck Microck commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Use Node SQLite's actual readOnly option rather than the silently ignored readonly spelling for usage and credential-metadata databases.
  • Centralize database opening in a small tested helper. Existing queries remain read-only; the connection now enforces that boundary too.
  • Add real SQLite regression tests proving reads succeed, writes fail, and a missing database is not created.
  • Prepare patch version 2.5.1; no credentials or real user databases were accessed.

Verification

56 backend tests passed, including both new real-SQLite checks. Automated assistant-run checks, not human testing.

AI-assisted by dot (OpenAI). The runtime does not expose the exact underlying model ID. Publication follows the owner's task-specific exception and authorization to fix Studio QA issues.

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
opencode-studio Ready Ready Preview Oct 24, 2026 9:53pm UTC

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8607ed15-f587-4c4d-a0f0-a528bba2d26a
Commits

Reviewing files that changed from the base of the PR and between 91fc9d3 and 0615f60.

Files ignored due to path filters: 1
  • server/package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 7
  • CHANGELOG.md
  • package.json
  • server/index.js
  • server/lib/native-credentials.js
  • server/lib/read-only-database.js
  • server/lib/read-only-database.test.js
  • server/package.json

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

The PR uses Node SQLite’s supported readOnly option for usage and credential-metadata databases, preventing writes and creation of missing database files.

  • The shared helper applies the option at both call sites; credential metadata reads remain limited to non-secret fields.
  • A real-SQLite regression test checks reads, rejected writes, and no file creation when the database is missing.
  • Test-run results and review findings were not provided.

Walkthrough

The change adds openReadOnlyDatabase, which opens SQLite databases with readOnly: true. Usage and credential database reads now use this helper. A regression test checks read access, rejected writes, and failure to create a missing database. The changelog and package versions are updated to 2.5.1.

Priority: Normal

Merge Risk: Minimal · up to 0615f

The read-only database change is ready to merge after normal checks; no blocking issue is established.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Microck commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review
Please review the read-only SQLite boundary fix and regression coverage. Node's DatabaseSync uses readOnly, not readonly; both callers now share the correctly configured helper. Exact-head regression CI passed. Tests use synthetic databases only.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Microck
Microck merged commit 146b405 into master Oct 24, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 0615f604 Deployed Oct 24, 2026 by vercel[bot]
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.

1 participant