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

solid-db useLiveQuery breaks with where + orderBy

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

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

  1. Clone this repo
  2. pnpm install && pnpm dev
  3. Go to localhost:3000
  4. Click the decrement all button a few times, then click the change name button 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 a useLiveQuery that views the list of items whose indices are between 1 and 4 inclusive. It then sorts the list items.
  • Clicking on decrement all in the UI will decrement each item's index value and should update the list displays accordingly.
  • Clicking on change name in the UI will add a + at the end of each item's name, it should update the list displays accordingly.

Screenshots

Image

Initial state.

Image

After clicking on decrement all once.

Image

After clicking on decrement all and change name a 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-db specific issue, as it seems like the collection itself is internally consistent, collection.subscribeChanges also fires events correctly, and generally, everything outside of useLiveQuery works appropriately.
  • I also have a more complex environment where I am using @tanstack/solid-db and again, the failure seems to be concentrated within the useLiveQuery, synchronization mechanism. If I replace useLiveQuery with a manual setState(Array.from(collection.entries())), everything updates correctly.
  • orderBy works fine without where.
  • where works without orderBy.
  • All logic works if I only have 1 <List> component.
主要言語
TypeScript
スター
3.9k
フォーク
272
平均マージ
1日 1時間
マージ済み PR(30日)
212

環境構築

はじめの一歩

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

TanStack/db のほかの issue

TanStack/db の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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