Make Search watch admission truthful and recoverable #1296

Merged
timmy merged 2 commits from timmy/1295-truthful-search-watch-admission into main 2026-08-23 06:36:04 +00:00
3 changed files with 8 additions and 1 deletions
Showing only changes of commit d3ba5975a0 - Show all commits

View File

@ -3785,6 +3785,7 @@ async def mutate_global_search_preview_subscription(
)
return JSONResponse({
**result,
"following_synced": True,
"following_revision": following["revision"],
"following_count": len(following["items"]),
})

View File

@ -42,7 +42,12 @@ async def test_confirmed_watch_updates_account_following_collection(monkeypatch,
following = await client.get("/api/v1/following")
assert watched.status_code == 200
assert watched.json() == {"watching": True, "following_revision": 1, "following_count": 1}
assert watched.json() == {
"watching": True,
"following_synced": True,
"following_revision": 1,
"following_count": 1,
}
assert following.status_code == 200
assert following.headers["cache-control"] == "no-store"
assert following.json() == {"revision": 1, "items": [{

View File

@ -285,6 +285,7 @@ async def test_search_preview_subscription_mutation_revalidates_target_and_confi
expected_count = 1 if watching else 0
assert response.json() == {
"watching": watching,
"following_synced": True,
"following_revision": expected_count,
"following_count": expected_count,
}