[2.0 / next] latest() over an optimistic guess answers the re-asked truth once a re-ask lands while the guess is pending
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, typescript
- 領域
- frontend
調査の方向性
The issue gives a reproducer using createOptimisticStore, createOptimistic, latest(), untrack(), and refresh(), but names no source files or tests. Start by searching the repository for latest() and optimistic store tests, then reproduce the table’s sequence: keep a guess pending while a refreshed source answer lands. Done when latest() continues to read the pending guess, matching the visible store and untrack() until the action settles.
索引モデルが issue の本文から書いたものです。
説明
On 2.0.0-rc.21 (next @ 2105ffb8).
A guess is pending on an optimistic store (or a createOptimistic). Its source is re-asked from outside the action and the new answer lands while the guess is still pending. The store keeps showing the guess (as #4330 intended), but latest() over it now answers the re-asked truth. Before the re-ask landed, latest() answered the guess. untrack() answers the guess throughout.
const [issues, setIssues] = createOptimisticStore(async d => { const r = await ask("fetch"); d.length = r.length; r.forEach((x, i) => { d[i] = { ...x }; }); }, [], { key: "id" });
const close = action(function* (id) {
setIssues(d => { const v = d.filter(t => t.id != id); d.length = v.length; v.forEach((x, i) => { d[i] = x; }); });
yield ask("close");
refresh(issues);
});
Steps: land fetch = [{id:1},{id:2},{id:3}]; close(1) (its close stays in flight); refresh(issues) from outside the action; land fetch = the same three rows.
| read | guess pending, before the re-ask lands | guess pending, re-ask landed | expected |
|---|---|---|---|
issues.length |
2 | 2 | 2 |
untrack(() => issues.length) |
2 | 2 | 2 |
latest(() => issues.length) |
2 | 3 | 2 |
latest(() => [...issues].map(x => ({...x}))).length |
2 | 3 | 2 |
The signal form does the same. createOptimistic(() => truth()) over createSignal(async () => ...), a guess title: "New" pending, then an outside refresh(truth) lands with "Old": detail().title and untrack say New, latest(() => detail().title) says Old.
On the screen: a tab count computed with latest(() => issues.length) shows 3 while the list under it shows 2 rows, until the close lands.
How we found it: ReactiveScript's latest x lowers to latest(), and its checker suggests latest x for a count read outside a loading on region. A fuzzed issue desk showed the count disagreeing with its own rows whenever a list refresh landed while a row close was in flight.
- 主要言語
- TypeScript
- スター
- 36.2k
- フォーク
- 1.1k
- 平均マージ
- 9時間 58分
- マージ済み PR(30日)
- 474
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
1.x
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
What gets passed to the `when` prop of a `Show` still gets executed twice on SSR対応中かも @brenelz が 6 日前に担当しました。 オープン1.x
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
solidjs/solid#4447 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
lingdojo/kana-dojo#33701 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rookslog/zlibrary-mcp#408 ·
メンテナーはふだん 1 日以内に返信
-
mp4box.js — 20-byte `sgpd` box with large `entry_count` causes unbounded loop and heap OOM abortオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
mastra-ai/mastra#29641 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信