Use tagged error guards across package copies - #7087
Conversation
🦋 Changeset detectedLatest commit: 4e5215a The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
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 |
There was a problem hiding this comment.
Important
This PR fixes real cross-copy recognition bugs, but it is missing the changeset required for the public effect package runtime changes.
Reviewed changes
This PR replaces constructor-identity instanceof checks with _tag-based guards for tagged errors so that duplicate package copies / module reloads recognize the same error type. Reviewed 10 files:
packages/effect/src/Config.ts— tag guard forConfigProvider.SourceErrorpackages/effect/src/unstable/rpc/RpcClient.ts— tag guard forRpcClientErrorpackages/effect/test/Config.test.tsandpackages/effect/test/rpc/RpcClient.test.ts— cross-copy regression testspackages/tools/api-diff/src/{Annotations,ApiDiff,Error,Snapshot,Worktrees}.ts— tag guards and adoption forApiDiffErrorandSnapshotExtractionErrorpackages/tools/api-diff/test/Error.test.ts— cross-copy guard tests
All tests, type checks, and lint pass.
⚠️ Missing changeset for effect package
The effect package has public runtime behavior changes (cross-copy SourceError and RpcClientError recognition). Per repo convention, this needs a .changeset/*.md entry. The @effect/api-diff package is private, so its new guards do not require one.
Technical details
# Missing changeset
## Affected sites
- `packages/effect/src/Config.ts:197-205` — `isSourceError` guard changes recoverable source-failure path
- `packages/effect/src/unstable/rpc/RpcClient.ts:55,966` — `isRpcClientError` guard changes error-preservation path
## Required outcome
- Add a `.changeset/*.md` entry bumping `effect` with a patch describing the cross-copy tagged-error recognition fix.@v0 or keep the SHA fresh with Dependabot | Fix it ➔ | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The only new commit since the prior review adds the missing changeset requested in the previous review.
- Added changeset for
effectpatch —.changeset/bright-tags-recognize.mdbumpseffectwith a patch note describing the cross-copy tagged-error recognition fix forConfigProvider.SourceErrorandRpcClientError.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Summary
ConfigProvider.SourceErrorandRpcClientErrorstructurally across duplicate package copies and module reloads_tagguards for the api-diff error rethrow pathsinstanceofchecks unchangedWhy
Tagged errors created by another copy of a module fail constructor-identity checks. That caused recoverable Config source failures to remain defects and genuine RPC/api-diff errors to be wrapped again.
Validation
pnpm vitest run packages/effect/test/Config.test.ts packages/effect/test/rpc/RpcClient.test.ts packages/tools/api-diff/test(180 tests)pnpm --dir packages/effect checkpnpm --dir packages/tools/api-diff checkpnpm lintCloses EFF-528
Closes EFF-529
Closes EFF-530
Closes EFF-531