fix cached history pagination and setup docs
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -59,6 +59,22 @@ def main() -> None:
|
||||
{message["id"] for message in history} == {first["id"], second["id"]},
|
||||
"history cache returned stale data after write",
|
||||
)
|
||||
|
||||
first_page_path = "/api/v1/chats/" + chat["id"] + "/messages?limit=1"
|
||||
first_page = client.call(
|
||||
"GET", first_page_path, actor=alice, schema="MessagePage"
|
||||
)["json"]
|
||||
cached_page = client.call(
|
||||
"GET", first_page_path, actor=alice, schema="MessagePage"
|
||||
)["json"]
|
||||
check(first_page == cached_page, "cached page differs from the first response")
|
||||
check(first_page["next_cursor"], "first page has no continuation cursor")
|
||||
client.call(
|
||||
"GET",
|
||||
first_page_path + "&cursor=" + first_page["next_cursor"],
|
||||
actor=alice,
|
||||
schema="MessagePage",
|
||||
)
|
||||
print("PASS: registration race, chat rollback and cache read-after-write")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user