How would you test pagination while records are changing?

Instruction: Give exact page expectations under the supplied snapshot contract and cover cursor misuse and expiry.

Context:

A fictional API sorts by (created_at, id) ascending. Its first request creates a snapshot that freezes membership and returned field values; later cursors are opaque and bound to the snapshot, tenant, filter and sort. Page size is 2. The snapshot lives 60 seconds. Initial rows are A@10, B@20, C@20, D@30 and E@40, with alphabetical ID as the tie-breaker. After page one, another client inserts X@15, changes D to @5 and deletes C. Under this exercise contract, expired cursors return 410, changed filter/sort returns 400 and another tenant using the cursor receives 403 without data.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

I would first assert page one is A then B and retain the returned cursor...

Related Questions