feat(column-query): キャッシュ検索をカラムの所属バケットで絞る - #961
Merged
Merged
Conversation
カラムクエリのキャッシュ遡り検索 (#783 Phase 3) はタイムライン種別で 絞っていなかった — notecli#30 以前は所属が後勝ち上書きで母集合を保証できず、 種別で絞ると取りこぼしになるため「混ざる側」に倒した妥協だった (068bb21 が notecli#30 待ちと明文化)。 実体/所属分離が入ったので、notecli の scan_cached_notes に追加された scope (notecli#57) を配線して妥協を解消する: - qir_search_cache に timeline_key (canonical, nullable) を追加。 parse 失敗は Err で顕在化、null は従来の全体走査 - フロントは loadMoreFromCache の searchable 分岐で columnCacheKey 由来の cacheKey を渡す — 別種別のノートが検索結果に混ざらなくなる - notecli rev を 203d9d8 (scan scope 追加) に bump Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Deploying notedeck with
|
| Latest commit: |
3e004c0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d90523ea.notedeck-d3a.pages.dev |
| Branch Preview URL: | https://feat-bucket-scoped-column-qu.notedeck-d3a.pages.dev |
API surface diff外部アプリ向け API 面 ( Full diffdiff --git a/src/bindings.ts b/src/bindings.ts
index 8659022..d697552 100644
--- a/src/bindings.ts
+++ b/src/bindings.ts
@@ -88,14 +88,20 @@ async qirValidate(query: QirQuery) : Promise<QirValidation> {
* 偽陰性を出さない規則に従うので (不変条件 (b))、FTS で落ちたノートが
* 本来マッチするということはない。
*
+ * `timeline_key` (canonical 文字列) を渡すと当該バケット所属のみを母集合に
+ * する。実体/所属分離 (notecli#30) 以前は所属が後勝ち上書きで種別絞りが
+ * 取りこぼしになるため全体走査しかなかったが、その妥協は解消済み。
+ * null は従来どおりアカウントの全キャッシュを走査する。
+ *
* 走査上限に達したら打ち切って継続カーソルを返す。呼び出し側は必要なだけ
- * 繰り返す (一度の呼び出しで巨大キャッシュを読み切らせない)。
+ * 繰り返す (一度の呼び出しで巨大キャッシュを読み切らせない)。カーソルは
+ * 同じ timeline_key の続き読みにのみ使うこと。
*
* @see src-tauri/src/commands/column_query.rs
*/
-async qirSearchCache(accountId: string, query: QirQuery, limit: number | null, maxScannedRows: number | null, cursor: QirSearchCursor | null) : Promise<Result<QirSearchResult, { code: string; message: string; apiCode: string | null }>> {
+async qirSearchCache(accountId: string, query: QirQuery, timelineKey: string | null, limit: number | null, maxScannedRows: number | null, cursor: QirSearchCursor | null) : Promise<Result<QirSearchResult, { code: string; message: string; apiCode: string | null }>> {
try {
- return { status: "ok", data: await TAURI_INVOKE("qir_search_cache", { accountId, query, limit, maxScannedRows, cursor }) };
+ return { status: "ok", data: await TAURI_INVOKE("qir_search_cache", { accountId, query, timelineKey, limit, maxScannedRows, cursor }) };
} catch (e) {
if(e instanceof Error) throw e;
else return { status: "error", error: e as any };
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
なぜ
カラムクエリのキャッシュ遡り検索(#783 Phase 3)はタイムライン種別で絞っていない。notecli#30 以前は所属が後勝ち上書きで母集合を保証できず、種別で絞ると「本来あるはずのノートが出てこない」取りこぼしになるため、気づける側(別種別が混ざる)に倒した意図的な妥協だった(068bb210 が notecli#30 待ちと明文化)。
実体/所属分離(V6)が入ったので、この妥協を解消する(notecli#30 仕様 v5 §12-9)。
変更内容
203d9d8(feat(db): scan_cached_notes にバケット絞り (scope) を追加 notecli#57:scan_cached_notesに scope 追加)に bumpqir_search_cacheにtimelineKey: string | nullを追加 — canonical キーで当該バケット所属のみを母集合にする。parse 失敗は Err で顕在化、null は従来の全体走査(挙動不変)loadMoreFromCacheの searchable 分岐でcolumnCacheKey由来のcacheKeyを渡す — クエリ付きカラムの遡り検索に別種別のノートが混ざらなくなるuseNoteColumnCacheの妥協コメントを解消済みの記述に更新、bindings.ts / openapi.json 再生成テスト
🤖 Generated with Claude Code