[2.0 next, regressed after rc.13] Awaited refresh returns the caller optimistic override
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 64/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, typescript
- 領域
- frontend
調査の方向性
Start with the reproduction in App.tsx and run repro.test.ts or snippet.test.ts using the linked setup. Then trace how refresh, action, and createOptimistic interact in Solid's source. Done means the awaited refresh returns the source value 2 rather than the optimistic override 99.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Refreshing an optimistic accessor inside its own action returns the optimistic guess instead of the source answer.
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Use the source below with the selected Solid build (complete setup is linked above).
import { action, createOptimistic, createSignal, refresh, resolve } from "solid-js";
export default function App() {
const [value, setValue] = createOptimistic(() => Promise.resolve(2));
const [result, setResult] = createSignal("idle");
const save = action(function* () {
setValue(99); // The caller's optimistic guess, not server truth.
return yield refresh(value);
});
async function run() {
await resolve(value);
setResult(String(await save())); // Observed 99; the source returns 2.
}
return (
<>
<button id="trigger" onClick={run}>
Refresh inside action
</button>
<output id="answer">{result()}</output>
</>
);
}
- Paste into a Solid 2 playground. Click Refresh inside action and wait.
Expected behavior
Expected: The output becomes 2, the value produced by the source.
Actual: The output becomes 99, the action’s optimistic guess.
Platform
- Solid:
solid-js/@solidjs/webnext at3086f1b77cd7b0431d3a7f768c2984c335758633; comparison2.0.0-rc.13. Signals, compiler and diagnostics match the selected Solid build. - OS: macOS 26.6.2 (25G83); browser cases: system Google Chrome 155.0.8059.40. Server-only/type checks run in Bun 1.4.2.
- Builds/comparison: development and production fail. rc.13 passes in both builds.
Additional context
Refresh requests authoritative data; the caller's optimistic overlay must not become that authoritative result.
Full automated reproduction
One-command setup, run and expected output.
Copy the standalone files into a fresh Bun project. The displayed snippet is executed by snippet.test.ts. The original automated case is also retained.
bun init -y
bun add [email protected] @solidjs/[email protected] @solidjs/[email protected] @solidjs/[email protected] @solidjs/[email protected]
bun add -d playwright
bun run link-head.ts /absolute/path/to/built/solid
BUILD_MODE=development bun test ./snippet.test.ts
The five linked packages must come from the same built HEAD checkout. Omitting the link step selects the rc.13 comparison. Chrome runs use the system installation.
- 主要言語
- TypeScript
- スター
- 36.1k
- フォーク
- 1.1k
- 平均マージ
- 11時間 45分
- マージ済み PR(30日)
- 329
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid のほかの issue
-
CHEATSHEET.md and RFC 02 still recommend module-scope state for app-wide state (follow-up to #3390)オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14対応中かも @itisrmk が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
[2.0 / next] Recovering before a held error commits throws the successful value対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 1〜2日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
area: aria/combobox gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
angular/components#33973 ·
メンテナーはふだん 1 日以内に返信
-
bug priority: P2
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
[bug] status, list and push crash with an uncaught NotInitializedError stack trace when teamai is not initialized対応中かも @jay23606 が今日担当しました。 オープンbug good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Tencent/teamai-cli#1227 ·
メンテナーはふだん 1 日以内に返信
-
[Tool]: Yapオープン
難易度 1/5 1〜3時間 初心者へのやさしさ 62/100
withkarann/aifoxx#417 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
sindresorhus/eslint-plugin-unicorn#3921 ·
メンテナーはふだん 1 日以内に返信