Skip to content

Migrate Effect usage to v4 - #307

Merged
eluce2 merged 1 commit into
mainfrom
t3code/migrate-effect-v4
Oct 2, 2026
Merged

eluce2 merged 1 commit into
mainfrom
t3code/migrate-effect-v4

Conversation

@eluce2

@eluce2 eluce2 commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Migrate all repository Effect usage to stable v4. Update fmodata services, generator binding, error recovery, and retry schedules; refresh the lockfile without unrelated dependency upgrades.

Includes a minor changeset for @proofkit/fmodata. Custom layers must use Effect v4.

Validation: pnpm run ci passed. Regression coverage verifies retry limits, exponential backoff, permanent errors, defect conversion, and database service overrides.

Summary by CodeRabbit

  • Compatibility
    • Updated @proofkit/fmodata for Effect v4.
  • Bug Fixes
    • Improved handling of retry limits, transient errors, and unexpected failures.
    • Preserved existing HTTP client and logger services when applying database configuration overrides.
  • Tests
    • Added coverage for retry behavior, error handling, and configuration overrides.

@changeset-bot

changeset-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 368778e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@proofkit/fmodata Minor
@proofkit/better-auth Patch
@proofkit/typegen Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
proofkit-docs Ready Ready Preview Oct 2, 2026 4:39pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (2)
AGENTS.md — auto-discovered
.cursor/rules/ultracite.mdc — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: proofsh/proofkit/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 199578d7-4167-4bef-be57-2ad6f6fd60c6

📥 Commits

Reviewing files that changed from the base of the PR and between 9131845 and 368778e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • .changeset/migrate-effect-v4.md
  • packages/fmodata/package.json
  • packages/fmodata/src/client/batch-builder.ts
  • packages/fmodata/src/client/delete-builder.ts
  • packages/fmodata/src/client/insert-builder.ts
  • packages/fmodata/src/client/record-builder.ts
  • packages/fmodata/src/client/schema-manager.ts
  • packages/fmodata/src/client/update-builder.ts
  • packages/fmodata/src/client/webhook-builder.ts
  • packages/fmodata/src/effect.ts
  • packages/fmodata/src/services.ts
  • packages/fmodata/tests/effect-layer-execution.test.ts
  • packages/fmodata/tests/effect-retry.test.ts

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The fmodata package now depends on Effect v4. Its service tags, generator calls, error conversion, and retry scheduling use updated Effect APIs. Tests cover database layer overrides, retry behavior, and defect conversion.

Changes

Effect v4 migration

Layer / File(s) Summary
Dependency and service contracts
.changeset/migrate-effect-v4.md, packages/fmodata/package.json, packages/fmodata/src/services.ts, packages/fmodata/tests/effect-layer-execution.test.ts
The package dependency changes to Effect v4, and service tags use Context.Service. The test checks merged database configuration overrides and retention of the HTTP client and logger.
Builder generator compatibility
packages/fmodata/src/client/*-builder.ts, packages/fmodata/src/client/schema-manager.ts, packages/fmodata/src/client/webhook-builder.ts
Builder, schema manager, and webhook operations pass their instance through the { self: this } option to Effect.gen.
Error conversion and retry behavior
packages/fmodata/src/effect.ts, packages/fmodata/tests/effect-retry.test.ts
Error conversion uses Effect.catch. Retry scheduling uses Schedule.max and schedule metadata to limit retries to transient errors. Tests cover retry limits, backoff, disabled retries, and defect conversion.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 36877

No actionable issue remains that would prevent merging after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: migrating Effect usage in fmodata to Effect v4.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 11 files. (2 skipped: 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@pkg-pr-new

pkg-pr-new Bot commented Oct 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

@proofkit/better-auth

pnpm add https://pkg.pr.new/@proofkit/better-auth@307

@proofkit/fmdapi

pnpm add https://pkg.pr.new/@proofkit/fmdapi@307

@proofkit/fmodata

pnpm add https://pkg.pr.new/@proofkit/fmodata@307

@proofkit/typegen

pnpm add https://pkg.pr.new/@proofkit/typegen@307

@proofkit/webviewer

pnpm add https://pkg.pr.new/@proofkit/webviewer@307

commit: 368778e

@eluce2
eluce2 merged commit 299341c into main Oct 2, 2026
18 checks passed

This branch was successfully deployed

1 active deployment
Preview — 368778e9 Deployed Oct 2, 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