Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSQL adapter data compaction bug/question #4865

Closed
zhakhalov opened this issue Jan 31, 2016 · 1 comment
Closed

WebSQL adapter data compaction bug/question #4865

zhakhalov opened this issue Jan 31, 2016 · 1 comment

Comments

@zhakhalov
Copy link

Hello!

I use PouchDB for storing data for my mobile app.
I'm going to use cordovaSQLite, but currently I make test in chrome and found wierd behaviour of compaction data.
I do not need reviosions in my app so I set revs_limit: 1.

But when I looked at sql database I saw following data.
Seems document-store table was compacted but by-sequence was not.

I do not know whether it is my fault or bug.

If it was my fault I would like to see advice about correct PouchOptions for websql adapter.

Thank, you!


by-sequence table

seq seq json deleted doc_id rev
1 1 {"loopMode":0,"isShuffle":false} 0 player 1-3aeaac058cbbb4814903567a0782e53c
2 2 {"loopMode":1,"isShuffle":false} 0 player 2-d9c93fa9e2b441bd8e9a9422b22c5261
3 3 {"loopMode":2,"isShuffle":false} 0 player 3-d4ae69e14db3edd2623693b5a03b52a2
4 4 {"loopMode":0,"isShuffle":false} 0 player 4-ba93f4777d819916e322b75da5f5aa63
5 5 {"loopMode":1,"isShuffle":false} 0 player 5-e6171407b8cb6370a3467e0257fbbe39
6 6 {"loopMode":2,"isShuffle":false} 0 player 6-b68bfec781e70b18dc3aefcb6bb41502
7 7 {"loopMode":0,"isShuffle":false} 0 player 7-a13f3744320b729e94310065d986f975
8 8 {"loopMode":1,"isShuffle":false} 0 player 8-c2e06dde45409a3394ad547426081035

document-store table

rowid id json winningseq max_seq
1 player {"id":"player","rev_tree":[{"pos":8,"ids":["c2e06dde45409a3394ad547426081035",{"status":"available"},[]]}],"seq":8} 8 8

Code that updates data

new PouchDB('player-data', {
  adapter: 'websql',
  auto_compaction: true,
  revs_limit: 1
})
.get('player')
.then(doc => {
  config._rev = doc._rev;
  return this.dbContext.put(config);
})
.catch(err => {
  console.log(err);
  throw err;
})
.then(() => config);
@nolanlawson
Copy link
Member

Thanks for reporting! This is a duplicate of #4372.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants