rocicorp / replicache

Realtime Sync for Any Backend Stack
https://doc.replicache.dev
1.02k stars 37 forks source link

scan might be broken before commit #962

Closed arv closed 2 years ago

arv commented 2 years ago

https://discord.com/channels/@me/900154212007174234/965689028802384002

I'm not sure this works and whether it is related:

const f = async (tx: WriteTransaction, args) => {
  await tx.put('a', 1);
  expect(await tx.scan().entries().toArray()).to.deep.equal([['a', 1]]);
}
arv commented 2 years ago

Verified that this is indeed not working any more!

arv commented 2 years ago

The problem was that when I refactored scan I was going all the way to the chunk store to get the data. In a WriteTransaction the BTree might have modified nodes that we need to use.