Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[2.0 next, regressed after rc.13] Awaited refresh returns the caller optimistic override

クローズ
#3,895 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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

Standalone reproduction

Steps to Reproduce the Bug or Issue
  1. 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>
    </>
  );
}
  1. 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/web next at 3086f1b77cd7b0431d3a7f768c2984c335758633; comparison 2.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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

solidjs/solid のほかの issue

solidjs/solid の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。