diigo-cache: test that a cached page replays fetch-time order
A hit must replay diigo's order as fetched (page_members.pos), not a column sort. The fake webapp's link_id and updated_at are scrambled so neither column sorts back into diigo's order; ordering the replay by updated or item_id fails the new test. Generated-by: Claude Opus 5.5
This commit is contained in:
1 parent
a1b1640e06
commit
80c9279825
2 files changed
+23
-3
No files matched your search
@@ -10,10 +10,13 @@ import { RpcTarget, WorkerEntrypoint } from "cloudflare:workers";
|
||||
const KNOWN_WEBAPP = "fake-webapp-id";
|
||||
const TOTAL = 30;
|
||||
|
||||
/** item n (1-based, updated-desc order): diigo's field names, made-up values */
|
||||
/** item n (1-based, in diigo's order): diigo's field names, made-up
|
||||
* values. link_id and updated_at are scrambled (distinct; 7 and 11 are
|
||||
* coprime to 31), so neither column sorts back into diigo's order — a
|
||||
* cache that replays by column rather than by fetch order is caught. */
|
||||
function item(n) {
|
||||
return {
|
||||
link_id: 1000 + n,
|
||||
link_id: 1000 + ((n * 7) % 31),
|
||||
url: `https://example.com/${n}`,
|
||||
title: `bookmark ${n}`,
|
||||
description: "",
|
||||
@@ -23,7 +26,7 @@ function item(n) {
|
||||
user_id: 4242,
|
||||
tags: "",
|
||||
created_at: 1700000000,
|
||||
updated_at: 1700001000 - n,
|
||||
updated_at: 1700001000 + ((n * 11) % 31),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user