Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

stop batch reads after limit is reached #3

Closed
max-mapper opened this issue May 4, 2013 · 1 comment
Closed

stop batch reads after limit is reached #3

max-mapper opened this issue May 4, 2013 · 1 comment

Comments

@max-mapper
Copy link
Contributor

see the TODO by onItem: https://github.com/maxogden/level.js/blob/master/iterator.js#L61

timkuijsten pushed a commit to timkuijsten/level.js that referenced this issue Feb 4, 2016
Fixes Level#43 Level#40 and Level#3. Unfortunately not easy to split out in separate commits.

1. Level#43 "snapshots seem not to work"

The reason snapshots didn't work in the test, is because the iterator was only
opened on the first call to _next. The new version opens the iterator right
away in the constructor (if there is no KeyRange error).

2. Level#40 "abstract-leveldown tests aren't all passing anymore"

Partially fixed by merging PR Level#42 and further fixed by this commit.

3. Level#3 "stop batch reads after limit is reached"

The solution is stop calling cursor.continue() once the limit is reached. The
transaction will automatically timeout as prescribed by the spec. idb-wrapper
can't be used for this because limit is only respected if autoContinue is true.

All 563 tests pass on:
* Safari 9.0.3
* Firefox 45.0b2
* Firefox 46.0a2
* Iridium 44.1 (Chrome/44.0.2403.157)
mvayngrib pushed a commit to mvayngrib/level.js that referenced this issue Aug 21, 2016
Fixes Level#43 Level#40 and Level#3. Unfortunately not easy to split out in separate commits.

1. Level#43 "snapshots seem not to work"

The reason snapshots didn't work in the test, is because the iterator was only
opened on the first call to _next. The new version opens the iterator right
away in the constructor (if there is no KeyRange error).

2. Level#40 "abstract-leveldown tests aren't all passing anymore"

Partially fixed by merging PR Level#42 and further fixed by this commit.

3. Level#3 "stop batch reads after limit is reached"

The solution is stop calling cursor.continue() once the limit is reached. The
transaction will automatically timeout as prescribed by the spec. idb-wrapper
can't be used for this because limit is only respected if autoContinue is true.

All 563 tests pass on:
* Safari 9.0.3
* Firefox 45.0b2
* Firefox 46.0a2
* Iridium 44.1 (Chrome/44.0.2403.157)
@vweevers
Copy link
Member

Fixed in #68.

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

No branches or pull requests

2 participants