Skip to content

bug(fts): D1 FTS5 upsert failures observed for diff rows across all repos #135

@liplus-lin-lay

Description

@liplus-lin-lay

observation

Cloudflare Workers logs (2026-04-26 cron run) show repeated `Failed to upsert FTS5 row for diff ...` errors across all 5 polled repos:

```
Failed to upsert FTS5 row for diff Liplus-Project/dipper_ai@07391bc
Failed to upsert FTS5 row for diff Liplus-Project/liplus-language@ce3b9d5 (multiple)
Failed to upsert FTS5 row for diff Liplus-Project/liplus-desktop@add899f
Failed to upsert FTS5 row for diff 770d7a9
Failed to upsert FTS5 row for diff Liplus-Project/github-webhook-mcp@1d237f4
```

Pattern: cross-repo (not specific to one repo), specifically on diff type rows. Long-standing per Master's framing.

scope

  • Affects `pollDiffs` → `processAndUpsertCommitDiff` path
  • D1 FTS5 mirror upsert fails; primary Vectorize upsert may still succeed (dual-store design)
  • Search recall on diff type queries may degrade (sparse side missing rows)

fix direction (memo)

Investigation needed to determine:

  • Specific D1 error (constraint violation? schema mismatch? rate limit?)
  • Whether the failure is per-call or per-row
  • Whether retry / fallback policy in `pipeline.ts` masks the failure level

The error message catches all upsert exceptions in `processAndUpsertCommitDiff` so root cause requires log-level enrichment or local repro.

related

  • 既存 `processAndUpsertCommitDiff` 内 try/catch 包囲 (`src/pipeline.ts`)
  • `src/fts.ts` upsertFtsRow / D1 FTS5 schema (`migrations/0001_fts5_init.sql`, `0002_fts5_rebuild.sql`)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug動いていない、壊れているmemoメモとして開始した状態。見出しは必要なものだけでよい

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions