Loading reveals content for page 1 while an open action still displays page 0

未关闭
#5,162 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@brenelz 已经在做这个了。

开始于 2026年11月24日。

  • #5186 来自 @brenelz —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
18/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
frontend

调研方向

The payload names no source files. Start from the linked reproduction and the Loading fallback behavior it exercises, then read the related first-reveal discussion in #2937. Done means the fallback stays visible until the action publishes page 1, and the heading and content show the same page. This touches reactive scheduling and action commit timing, so it needs maintainer guidance.

由索引模型根据 Issue 内容生成。

描述

Describe the bug

An action changes the selected page from 0 to 1 and stays open for one second. The heading keeps showing page 0. If the async memo was still waiting for its first answer when the action started, its answer for page 1 replaces the loading fallback after half a second. The heading and content then identify different pages.

Both are ordinary reads of the same selection:

const content = createMemo(() => fetchPage(id()));

const navigate = action(function* () {
  setId(1);
  yield delay(1000);
});

// Rendered together
<h2>Page {id()}</h2>
<Loading fallback="Loading…">{content()}</Loading>
Your Example Website or App

https://s.olid.uk/id/Mg06xZKxScW3rjoMkpkJng

Steps to Reproduce the Bug or Issue
  1. Open the reproduction. It shows “Page 0” and “Loading…”. The page 0 request stays unresolved so there is no timing requirement for the click.
  2. Click Go to page 1. After 500 ms the content reads “Content for page 1”, but the heading still reads “Page 0”.
  3. After another 500 ms the action finishes and the heading changes to “Page 1”.
Expected behavior

While the action holds the selection at page 0, the fallback stays visible. Once the action finishes, “Page 1” and “Content for page 1” appear together. The request for page 1 can start immediately.

Screenshots or Videos

No response

Platform

Solid 2.0.3, Chromium on Linux.

Additional context

The first-reveal behavior described in #2937 seems relevant. In that example the action waited for fallback cleanup. Here the action waits only for a timer, and the resolved content was fetched using the action’s still-unpublished selection.

主要语言
TypeScript
星标
37k
派生
1.2k
平均合并
8 小时 43 分钟
30 天内合并 PR
365

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

solidjs/solid 的其他 Issue

查看 solidjs/solid 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。