Skip to content

fix(js): correct sqlite maxMemory unit handling#1609

Merged
chaliy merged 1 commit into
mainfrom
2026-05-08-fix-js-sqlite-memory-cap-issue
May 8, 2026
Merged

fix(js): correct sqlite maxMemory unit handling#1609
chaliy merged 1 commit into
mainfrom
2026-05-08-fix-js-sqlite-memory-cap-issue

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented May 8, 2026

Motivation

  • Fix a unit-mismatch bug where the JS maxMemory (documented and used as bytes) was treated as MiB when deriving SqliteLimits, inflating max_db_bytes and weakening host memory controls.

Description

  • In derive_sqlite_limits use state.max_memory as bytes by renaming the local to memory_bytes and removing the * 1024 * 1024 multiplication so max_db_bytes is computed as memory_bytes.max(0.0).floor() as usize.

Testing

  • Ran cargo fmt --all which completed successfully and cargo check -p bashkit-js which finished successfully.

Codex Task

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 8, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 8f46d36 Commit Preview URL May 08 2026, 07:21 PM

@chaliy chaliy merged commit 5c1335e into main May 8, 2026
26 checks passed
@chaliy chaliy deleted the 2026-05-08-fix-js-sqlite-memory-cap-issue branch May 8, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant