知识列表拿游标做 keyset 分页时写成了 `cur.item_id`,而 `Cursor` 只有 `created_at` 和 `id` 两个字段——属性不存在,直接 AttributeError, 前端只看到"服务器内部错误"。 库里不足一页(默认 30 条)时永远走不到这条分支,所以一直没暴露; 旧备忘导进来 84 条之后,用户点「加载更多」就撞上了。 补一条回归用例:造 25 条、每页 10 条翻到底,断言不重不漏、末页游标为空。
This commit is contained in:
@@ -328,7 +328,7 @@ async def list_knowledge(
|
||||
stmt = stmt.where(
|
||||
or_(
|
||||
Item.updated_at < cur.created_at,
|
||||
and_(Item.updated_at == cur.created_at, Item.id < cur.item_id),
|
||||
and_(Item.updated_at == cur.created_at, Item.id < cur.id),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user