You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you call close on a Python or Ruby cursor object, and then try to read from it again you will get an error. However, on JavaScript it will continue to give you data out of the buffer until it is empty (and then error). We should probably do what we do on the Python one, and empty out the buffer immediately.
This should have probably been documented as a breaking change. It is described as a cleanup fix but it actually adds a new error which existing v2.2.0 is probably not expecting.
It looks like the new version throws a ReqlDriverError with the message "Cursor is closed.", while the old version might have thrown a different error, but in general had undefined behavior (it would sometimes return more rows and never throw an error, sometimes return a few results and then throw an error, and sometimes throw an error immediately).
The new behavior for the first time defines what the behavior for reading from a cursor after closing it is, so I'm not sure if this qualifies as a breaking change.
In general we should get better at pointing out changed error messages in our release notes though. We are currently not mentioning such changes anywhere.
The exception was new in the way I was using it and it broke a bunch of tests. The release was already a breaking release so there was no issues there, just that this change was billed as a minor fix when it actually changed significant behavior. It was the right change to make.
If you call
close
on a Python or Rubycursor
object, and then try to read from it again you will get an error. However, on JavaScript it will continue to give you data out of the buffer until it is empty (and then error). We should probably do what we do on the Python one, and empty out the buffer immediately.Note, this is related to #5056.
The text was updated successfully, but these errors were encountered: