Skip to content

A tombstone pushed to an api source with an external_id no longer needs a filename, so {"external_id":"note-7","deleted":true} marks the document missing instead of being rejected - #1487

Merged
WaylandYang merged 2 commits into
devfrom
fix/api-tombstone-without-filename
Nov 10, 2026

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

重提 #1393(原作者 @QuintinBotes 发现的问题,谢谢),带上 10-24 评审要的三处测试修改。

IngestBody.filename 加 #[serde(default)]:墓碑的身份是 external_id,处理路径本来就不看文件名,但字段必填让 {"external_id": …, "deleted": true} 在反序列化那一步就被拒。其余情况不变:有内容的推送缺文件名仍然 400(filename.trim().is_empty() 的校验还在)。文档表里的 filename 一行注明墓碑可省。

怎么验证的

  • 新测试 an_api_tombstone_needs_only_its_external_id:推一条 note-7,再推只带 external_id 的墓碑,断言 api:note-7 这份文档的 missing_since 真的设了(回复对没推过的 id 也是 marked_missing,所以不看回复看文档);再推一条有内容没文件名的,断言不是 200;结尾 f.cleanup().await。
  • 本地对 schema 112 的测试库跑过:cargo test -p utopia-server an_api_tombstone_needs_only_its_external_id 通过。

Closes #1393 的讨论;关联 #1393。

🤖 Generated with Claude Code

…ds a filename, so {"external_id":"note-7","deleted":true} marks the document missing instead of being rejected

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@WaylandYang
WaylandYang merged commit c838d91 into dev Nov 10, 2026
6 checks passed
@WaylandYang
WaylandYang deleted the fix/api-tombstone-without-filename branch November 10, 2026 16:11
gedaiu added a commit to re-cinq/utopia that referenced this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant