-
Notifications
You must be signed in to change notification settings - Fork 67
SWIFT-958 Ensure nil is returned from next() before ClosedCursorError #521
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
SWIFT-958 Ensure nil is returned from next() before ClosedCursorError #521
Conversation
| var count = 0 | ||
| for result in cursor { | ||
| expect(count).to(beLessThan(2)) | ||
| if count >= 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not get these tests to halt after failing an expect, so I manually added breaks. I tried setting self.continueAfterFailure = false, but it didn't seem to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, weird 🤔
Codecov Report
@@ Coverage Diff @@
## master #521 +/- ##
==========================================
- Coverage 77.65% 77.65% -0.01%
==========================================
Files 130 130
Lines 13876 13910 +34
==========================================
+ Hits 10776 10802 +26
- Misses 3100 3108 +8
Continue to review full report at Codecov.
|
kmahar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
| var count = 0 | ||
| for result in cursor { | ||
| expect(count).to(beLessThan(2)) | ||
| if count >= 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, weird 🤔
SWIFT-958
This fixes a bug where cursors would iterate forever after encountering a non-
DecodingErrorby ensuringnextreturnsnilonce after the error. This does not apply totryNextortoArray, since those arethrows. Also, in the case oftryNext,nildoesn't necessarily imply that the cursor is dead.