apache / apache/pouchdb

Unable to get paginated changes in descending order

Open
#8,954 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17.6k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### Issue

I'd like to display recent changes to users and wrote some code like:

```js
let since = 'now';
for (let i = 0; i < 5; i++) {
const r = await db.changes({
since,
limit: 5,
descending: true,
});
since = r.last_seq;
console.log(since);
}
```

However, the database always returns the same 5 items, while `last_seq` is always the `seq` value of 5th item.

It works fine when `descending=false` and starting from `since=0`.

### Info
- Environment: browser
- Platform: FF Nightly 128.0a1
- Adapter: idb
- Server: n/a

### Reproduce
https://pouchdb-bug-helper.glitch.me/ doesn't seems to work

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.