Skip to content

fix(server): restore correct Layer.provideMerge arg order for sqlite setup#8

Merged
Josh-wt merged 1 commit intomainfrom
claude/setup-server-dev-V0Pu8
Apr 12, 2026
Merged

fix(server): restore correct Layer.provideMerge arg order for sqlite setup#8
Josh-wt merged 1 commit intomainfrom
claude/setup-server-dev-V0Pu8

Conversation

@Josh-wt
Copy link
Copy Markdown
Owner

@Josh-wt Josh-wt commented Apr 12, 2026

Summary

  • Layer.provideMerge(self, that) feeds that into selfthat is the provider, self is the consumer
  • setup needs SqlClient.SqlClient (yields it to run PRAGMAs and migrations); makeRuntimeSqliteLayer produces it
  • Commit f44e39f swapped the args so setup was treated as the provider, leaving itself with no SqlClient in context → "Service not found: effect/sql/SqlClient" on startup
  • Restores the original correct order for both makeSqlitePersistenceLive and SqlitePersistenceMemory

Test plan

  • cd apps/server && bun run dev starts without the "Service not found: effect/sql/SqlClient" error
  • Server connects and sessions can be created normally

https://claude.ai/code/session_01BpwxjJ9XzBeAXjRp86E9Jr


Summary by cubic

Fix SQLite startup by restoring the correct Layer.provideMerge(self, that) order so setup consumes the SqlClient from makeRuntimeSqliteLayer. Prevents "Service not found: effect/sql/SqlClient" on server boot.

  • Bug Fixes
    • Swapped args in makeSqlitePersistenceLive and SqlitePersistenceMemory so setup can run PRAGMAs/migrations with a valid client.
    • apps/server dev now starts clean; sessions can be created normally.

Written for commit 339b635. Summary will update on new commits.

Summary by CodeRabbit

  • Refactor
    • Optimized SQLite persistence layer initialization sequence to enhance system stability during database operations.

…setup

Layer.provideMerge(self, that) feeds `that` into `self`. The `setup`
layer needs SqlClient.SqlClient (to run PRAGMAs and migrations), while
`makeRuntimeSqliteLayer` produces it. Having them swapped left `setup`
with no SqlClient in context, causing "Service not found: effect/sql/SqlClient".

Reverts the arg-order change introduced in f44e39f.

https://claude.ai/code/session_01BpwxjJ9XzBeAXjRp86E9Jr
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 81ebd76c-de8e-43cd-8065-24463151e46a

📥 Commits

Reviewing files that changed from the base of the PR and between b62aeb4 and 339b635.

📒 Files selected for processing (1)
  • apps/server/src/persistence/Layers/Sqlite.ts

📝 Walkthrough

Walkthrough

The SQLite persistence layer's dependency injection setup was reordered. In makeSqlitePersistenceLive, the setup layer is now provided before makeRuntimeSqliteLayer(). For SqlitePersistenceMemory, the ordering was reversed, placing setup after the runtime SQLite layer initialization.

Changes

Cohort / File(s) Summary
SQLite Persistence Layer Reordering
apps/server/src/persistence/Layers/Sqlite.ts
Reordered Layer.provideMerge operations: moved setup before makeRuntimeSqliteLayer() in makeSqlitePersistenceLive, and after the runtime layer in SqlitePersistenceMemory to resolve layer dependency provision order.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 Layers dancing in a queue,
Setup first, then runtime through,
Dependencies in proper place,
SQLite runs at quickened pace!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/setup-server-dev-V0Pu8

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 and usage tips.

@Josh-wt Josh-wt merged commit 2f4d880 into main Apr 12, 2026
1 check was pending
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.

2 participants