A live hole silently stops re-emitting when its markup has a conditional on a property (`{m.usage && …}`)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, typescript
Hướng nghiên cứu
Start with the repro in the issue: a live GET server component whose markup holds a createMemo over an async source, with a {m.usage && <b>done</b>} conditional inside a .map() row. Compare the streamed hole events with and without the conditional, as the issue's table does. The likely area is how the compiler memoises conditionals whose condition is a property access, and how a memo created inside a re-running hole is tracked. The existing chat example's comment about owner creation is a lead. Done means the hole re-emits, or a dev diagnostic names the expression.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
In a live server component, a markup hole stops re-emitting, silently, when the expression it renders contains a conditional whose condition is a property access. The first render is correct. After that the hole is never sent again, however often its source yields. There is no error, no warning and no diagnostic, on the server or in the browser. Slot arguments in the same component keep updating, which makes it look like a client problem.
What it takes
A live(GET(…)) server function that answers with a component, with a memo over an async iterable read in its markup:
const getThread = liveQuery(
live(
GET(async (id: string) => {
"use server";
return (props: { composer: ComposerSlot }) => {
const view = createMemo(() => db.watchThread(id, signal)); // yields the thread on every write
return (
<article>
<ol>
{view().messages.map(m => (
<li data-id={m.id}>
{m.text.length} {m.usage && <b>done</b>}
</li>
))}
</ol>
<props.composer seen={view().messages.map(m => m.id)} />
</article>
);
};
})
),
"thread"
);
m.usage is undefined until a reply finishes; m.text grows about every 50 ms while one is being written.
What happens
I connected to the live address with curl -N for the length of one reply (about 40 writes to the thread) and counted the events on the stream, changing only the expression inside the <li>:
Inside the <li> |
hole events for the list |
slot-argument events |
|---|---|---|
{m.text.length} |
39 | 43 |
{m.text.length} {m.usage && <b>done</b>} |
0 | 43 |
{m.text.length} {m.usage ? <b>done</b> : null} |
0 | 43 |
const usage = m.usage; then {m.text.length} {usage && <b>done</b>} |
39 | 43 |
In the two failing rows the stream carries the initial html event, with the list registered as a hole and given a digest, and then nothing more for it. In the browser the list stays as first rendered while the composer's seen prop keeps changing.
The same happens when the conditional is inside a plain helper function called from the hole, and with <For> in place of .map(). A condition that is a local identifier (generating && …, where const generating = m.status === "generating") is fine.
What I think is going on
Not established; a reading of the symptoms. The compiler memoises a conditional whose condition it cannot see through (a.b && …, a.b ? … : …). The existing chat example's comments say a live hole "can't mint components as it grows" (an owner-creation latch). A memo created inside a hole on each re-run looks like the same thing, with the difference that nothing reports it and the hole goes quiet instead.
Expected
Either the hole re-emits, or, if creating a memo inside a re-running hole is not supported, a dev diagnostic says so and names the expression. As it stands the markup is silently stale, and the workaround (hoist the property into a local) is not something a reader would guess.
Notes
- Found while rebuilding the chat example as a live server component. It first appeared as
{message.reasoning && <details>…}and{message.usage && <span>…}in a message's markup, and took a bisect of the raw stream to find. - Related, and loud rather than silent: a memo over an async source created per row inside the list (
createMemo(() => db.watchMessage(id))in a row component) fails the document render with<Loading> boundary discovery did not converge after 10001 passes. That one at least says something.
Environment
solidjs/solidnextatdf4e36516, dev build ofsolid-jsand@solidjs/webfrom the workspace@solidjs/router2.0.0-next.38,@solidjs/vite-plugin3.0.0-next.49, Vite 8, dev server- macOS, Node 26; the stream was read with curl, the page in Chromium 152
- Ngôn ngữ chính
- TypeScript
- Star
- 36.1k
- Fork
- 1.1k
- Merge trung bình
- 10 giờ 41 phút
- Pull request đã merge (30 ngày)
- 363
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 solidjs/solid
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày 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
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
signals: a landing reveals a held write its stale reader re-derives onto a new flight (U-5, D-9)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid
Issue tương tự
-
test: make the #3408 Claude OAuth token fixture obviously fake so secret scanners stop flagging itĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
code-yeongyu/senpi#3436 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
lingdojo/kana-dojo#32505 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
code-quality refactoring
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/gh-aw-firewall#10040 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
review-followup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
griffinwork40/agent-afk#3868 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: import-export bug status: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
amatya-aditya/obsidian-rss-dashboard#1191 ·
Maintainer thường phản hồi trong vòng 1 ngày