When refs are sorted by dates, order is incorrect
Taken from the [Merge Request](https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2932#note_523185315): <hr/> There's buggy behavior: When refs are sorted by committerdate and page token is passed, then weird results are returned. It works fine when refs are sorted by refname though. `IsPageToken` defined in internal/gitaly/service/ref/refs.go is using `bytes.Compare` which compares refs alphabethically. It works fine when refs are being sorted by refname, but when we sort by another field, `IsPageToken` would unexpectedly return the first result that is greater alphabetically. For example, if refs have been created in the following order: `a` `c` `b` `d` and we pass `{ SortBy: 'updated_asc', PageToken: 'b', Limit: 1 }`, then we get the ref `b`, while the expected result is `d`. We can use `bytes.HasPrefix` instead to fix this case Related issue: https://gitlab.com/gitlab-org/gitlab/-/issues/321196 Feature flags: - `branches_pagination_without_count` - `branch_list_keyset_pagination`
issue