fix: harden wiki delivery and leaderboard performance
This commit is contained in:
1 parent
4b86106a24
commit
e053b36b6e
28 files changed
+616
-68
No files matched your search
@@ -54,7 +54,11 @@ class FakeWeKnora:
|
||||
return {"id": knowledge_base_id, "indexing_strategy": {"wiki_enabled": True}}
|
||||
|
||||
async def list_wiki_pages(self, knowledge_base_id: str, *, page: int, page_size: int):
|
||||
return {"pages": [{"slug": item["slug"], "title": item["title"]} for item in self.pages.values()], "total_pages": 1}
|
||||
return {
|
||||
"pages": [{"slug": item["slug"], "title": item["title"]} for item in self.pages.values()],
|
||||
"total": len(self.pages),
|
||||
"total_pages": 1,
|
||||
}
|
||||
|
||||
async def get_wiki_page(self, knowledge_base_id: str, slug: str):
|
||||
return dict(self.pages[slug])
|
||||
@@ -139,6 +143,10 @@ async def test_sync_is_incremental_and_full_scan_deletes_missing_pages() -> None
|
||||
first = await service.sync_mapping(mapping)
|
||||
assert first["changed_pages"] == 1
|
||||
assert embedding.calls == 1
|
||||
statuses = await store.list_page_index_status("kb")
|
||||
assert statuses[0]["title"] == "One"
|
||||
assert statuses[0]["vector_count"] > 0
|
||||
assert store.states["kb"]["remote_page_count"] == 1
|
||||
second = await service.sync_mapping(mapping)
|
||||
assert second["changed_pages"] == 0
|
||||
assert embedding.calls == 1
|
||||
|
||||
Reference in new issue
Block a user