In case of conflict (because of revs_limit reached), PouchDb gives us outdated revision in sync/change callback
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
### Issue
After being offline for a while, in case of conflict (because of revs_limit reached), PouchDb gives us in change callback an outdated revision.
### Info
- Environment: Electron App 21.4.2 / Vue.js 3 / PouchDB 8.0.1
- Platform: Electron/Chromium
- Adapter: indexeddb
- Server: CouchDB
### Reproduce
1. You start livesync on a database.
2. You go offline.
3. You modify a single doc a number of times upper than the revs_limit defined.
4. You go back online
5. PouchDB syncs (push) the modified docs to the CouchDB server
6. This results in a conflict (the winner is determined by the server, always choosing the last revision)
7. PouchDB is notified of changes (pull) (conflict résolution)
8. PouchDB made 3 pull with the same changes and calls our 'change' callback but gives us each time the same revision : the one that is declared as conflicting.
9. If in this change callback, we make a `db.get(docId)`, this correctly returns the right revision (the last) (So the data in the local database are good)
To avoid this behaviour, we increased the revs_limit, but I supposed there is a better way ;)
Regards
Manuel
Contributor guide
Assessment
This issue has not been assessed yet.