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

Local Zotero: sub-collections always come back empty (stray quote in collectionSQL)

オープン 初心者向け
#1,137 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
sqlite, typescript
領域
backend, databases

調査の方向性

packages/editor-server/src/core/zotero/local/source.ts の 594 行目付近にある collectionSQL() から始め、553 行目付近にある creatorsSQL() とサブコレクションの分岐を比較します。生成された SQL から余分な引用符を削除し、空でない parentKey を使用して Zotero SQLite fixture に対するテストを追加するか、構文エラーを検出できるように SQL を準備します。サブコレクションが SQLite の構文エラーなしに項目を読み込めれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Bug

collectionSQL() in packages/editor-server/src/core/zotero/local/source.ts:594 has a stray single quote in the sub-collection branch:

const where = spec.parentKey.length > 0
  ? `AND collections.key = :k'`   // <-- trailing '
  : `AND libraries.libraryID = :k`;

The ' opens an unterminated string literal, so the query fails with a SQLite syntax error whenever spec.parentKey is non-empty, i.e. for any Zotero sub-collection read from the local database.

Impact

The error is caught in the collection reader (source.ts ~line 280: console.error(error); return collection;), so a sub-collection silently comes back with zero items. Users see the sub-collection in the citation UI with nothing in it, and nothing surfaces except a console log in the LSP output.

Top-level libraries are unaffected (they take the other branch).

Fix

Drop the quote: AND collections.key = :k. The sibling creatorsSQL() (~line 553) already has the correct form.

Testing

Worth adding a test that runs collectionSQL() for a spec with a non-empty parentKey against a fixture Zotero sqlite (or at least db.prepare()s the SQL), so a syntax error like this gets caught.

Found during the dependency-upgrade research.

主要言語
TypeScript
スター
655
フォーク
64
平均マージ
8時間 45分
マージ済み PR(30日)
36

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

quarto-dev/quarto のほかの issue

quarto-dev/quarto の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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