solid-db useLiveQuery breaks with where + orderBy
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
リンクされている再現リポジトリから始めて、pnpm install && pnpm dev を実行し、4 つの List コンポーネントと decrement all および change name アクションを使って失敗を再現します。useLiveQuery の同期パスを読み、issue に記載されている手動の Array.from(collection.entries()) 更新と動作を比較します。完了の条件は、両方のアクションの後も、結合された where および orderBy クエリがすべてのコンポーネントで正しいままであることです。
索引モデルが issue の本文から書いたものです。
説明
- I've validated the bug against the latest version of DB packages
Describe the bug
When using the same useLiveQuery with a where and orderBy clause in multiple components, query logic tends to break.
To Reproduce
Steps to reproduce the behavior:
- Clone this repo
pnpm install && pnpm dev- Go to
localhost:3000 - Click the
decrement allbutton a few times, then click thechange namebutton a few times, UI should break unexpectedly.
Expected behavior
- The DB stores a list of items, each with an index, independent UUID (which is used as the key), and name.
- The UI contains 4 identical
<List>components, each one has auseLiveQuerythat views the list of items whose indices are between 1 and 4 inclusive. It then sorts the list items. - Clicking on
decrement allin the UI will decrement each item's index value and should update the list displays accordingly. - Clicking on
change namein the UI will add a+at the end of each item's name, it should update the list displays accordingly.
Screenshots
Initial state.
After clicking on
decrement allonce.
After clicking on
decrement allandchange namea few times.
Desktop (please complete the following information):
- OS: 25.11.20260113.2c3e5ec (Xantusia)
- Browser: Firefox
- Version: 146.0.1
Additional context
- I am not well-versed in the internals of Tanstack DB but I believe this is a
solid-dbspecific issue, as it seems like the collection itself is internally consistent,collection.subscribeChangesalso fires events correctly, and generally, everything outside ofuseLiveQueryworks appropriately. - I also have a more complex environment where I am using
@tanstack/solid-dband again, the failure seems to be concentrated within theuseLiveQuery, synchronization mechanism. If I replaceuseLiveQuerywith a manualsetState(Array.from(collection.entries())), everything updates correctly. orderByworks fine withoutwhere.whereworks withoutorderBy.- All logic works if I only have 1
<List>component.
- 主要言語
- TypeScript
- スター
- 3.9k
- フォーク
- 272
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 212
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/db のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
electric-db-collection: on-demand + persistence fails after relaunch with "Snapshot requests are not supported in full mode"対応中かも @KyleAMathews が 3 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
TanStack/db#2056 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
awaiting-response bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
wildcard/caro#1562 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
supadata-ai/mcp#27 ·
-
content
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cosimochellini/one-piece-zero-spoiler#516 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
capricorn86/happy-dom#2485 ·
メンテナーはふだん 2 日以内に返信
-
lane: fast
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
unicef/adt-studio#946 ·
メンテナーはふだん 2 日以内に返信