fix(e2b): stabilize pagination for duplicate timestamps#563
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @chacha923! It looks like this is your first PR to openkruise/agents 🎉 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #563 +/- ##
==========================================
+ Coverage 79.67% 79.75% +0.07%
==========================================
Files 194 194
Lines 13784 13836 +52
==========================================
+ Hits 10983 11035 +52
Misses 2403 2403
Partials 398 398
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Use an opaque cursor with both the sort key and a unique object key when listing sandboxes and snapshots. Keep raw sort-key tokens compatible for existing clients. Fixes openkruise#439 Signed-off-by: zhuangzhewei <zhuangzhewei09@dingtalk.com>
c4a8a7c to
42ca70c
Compare
|
Hello @furykerry @AiRanthem @zmberg , |
What this PR does
Fixes pagination for
GET /v2/sandboxesand snapshot listing when multiple objects share the same timestamp sort key.The previous cursor only stored the timestamp of the last returned item. Since claim timestamps and checkpoint creation timestamps can collide, the next page searched for the first item strictly after that timestamp and skipped remaining objects with the same timestamp.
This PR adds an optional stable cursor to the internal paginator. When a unique key is configured, pagination now sorts and resumes by
(sort key, unique key), encodes the cursor as an opaque base64 JSON token, and keeps raw sort-key tokens compatible for existing clients.Changes
GetUniqueKeysupport topkg/utils/pagination.Paginator.namespace/namefallback.Tests
Fixes #439