Schema encoding can return an internal symbol across module copies
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #10382 của @schickling-assistant — đã merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start with packages/effect/test/schema/HMR.test.ts and reproduce the two failing cases using separate imports after vi.resetModules(). Then read internal/schema/parser.ts and trace how missing, missingExit, and sameExit are compared by the parser and its consumers. Done means the regression tests return the original empty string and false across module copies; an open linked pull request is already addressing the issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Schema encoding can return an internal symbol across module copies
Reproduction
Reproduced on main at c0981a29044194e7e1ad35cb7aad02c5849d5aab. Two independently loaded Effect module graphs in the same realm can disagree about parser sentinels:
import { expect, it, vi } from "vitest"
it.each(["", false])("encodes %j across module copies", async (input) => {
const A = await import("effect/Schema")
vi.resetModules()
const B = await import("effect/Schema")
const schema = typeof input === "string" ? A.String : A.Boolean
expect(B.encodeSync(schema)(input)).toBe(input)
})
Expected: "" and false, respectively. Actual: Symbol() in both cases. The equivalent regression added to packages/effect/test/schema/HMR.test.ts fails twice before the fix (the five existing tests pass).
This surfaced in LiveStore DevTools, where the application creates schemas and a separately bundled DevTools copy of Effect encodes them.
Root cause
internal/schema/parser.ts allocates module-local missing, missingExit, and sameExit. AST parser methods retain their creating module's sentinels, while SchemaParser and the interpreter/codegen consumers compare against their own sentinels by identity. An unrecognized foreign sameExit is treated as an ordinary success containing a foreign missing symbol, which escapes as the encoded value.
Sharing only missing is insufficient: sameExit is also identity-sensitive and means “return the original input,” not “return missing.” A namespaced same-realm global registry can share the exit objects as well as the missing symbol. This addresses copies implementing the shared protocol; it does not retrofit an already loaded unpatched copy or transfer identities across realms.
Related precedent: #1561 (CJS–ESM hazard).
Posted on behalf of @schickling
| field | value |
|---|---|
agent_identity |
agent/livestore/owner |
session |
01a1f40c |
agent_persona |
generalist |
agent_supervisor |
unavailable |
agent_tool |
OMP |
agent_tool_version |
18.12.5 |
agent_runtime |
OMP 18.12.5 |
agent_model |
anthropic/claude-opus-5-5 |
worktree |
unknown |
- Ngôn ngữ chính
- TypeScript
- Star
- 16.7k
- Fork
- 808
- Merge trung bình
- 12 giờ 17 phút
- Pull request đã merge (30 ngày)
- 805
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Effect-TS/effect
-
From Discord: Return Stream.empty for HTTP requests with an empty bodyCó thể đã có người làm @pujitha24 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sql-pg: scoped connection shutdown retains a socket when the peer withholds FINCó thể đã có người làm @effect-bot đã nhận 1 ngày trước. Đang mở
Effect-TS/effect#10458 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Schema: a public way to derive a canonical codec, as `toCodecJson` and `toCodecStringTree` doCó thể đã có người làm @effect-bot đã nhận 1 ngày trước. Đang mởNeeds Proposal schema
Effect-TS/effect#10457 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
McpServer.layerHttp: optional legacy GET SSE for idle list-change notificationsCó thể đã có người làm @effect-bot đã nhận 2 ngày trước. Đang mở
Effect-TS/effect#10436 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SqlClient: a fiber forked inside a transaction keeps using its connection after the transaction endsCó thể đã có người làm @effect-bot đã nhận 2 ngày trước. Đang mởbug
Effect-TS/effect#10431 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Effect-TS/effect
Issue tương tự
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openclaw/openclaw#195577 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: 对话界面点击右上角设备管理后,无法返回Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
EKKOLearnAI/ekko-studio#3729 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
Supportseal/SupportSeal-app#98 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
eliasstravik/herdr-projects#845 ·
-
agents-sdk: webhooks-push.md handler reads the request body twice, so verified webhooks failĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
cloudflare/skills#279 ·
Maintainer thường phản hồi trong vòng 1 ngày