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

Fix issue when VersionedResult can lose first row of the data #79

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

s-vitaliy
Copy link
Contributor

@s-vitaliy s-vitaliy commented Nov 8, 2024

Part of #61

This PR fixes the issue which can occur when the method getLatestVersion of the HasVersion typeclass peeks the first element of the VersionedBatch.

In this case the stateful ResultSet inside this class moves forward and the first row of the set is being lost.

To avoid this issue, the CanPeekHead trait was added. The implementation of this trait saves the first row of the ResultSet if the head of the ResultSet was requested.

Checklist

  • GitHub issue exists for this change.
  • Unit tests added and they pass.
  • Line Coverage is at least 80%.
  • Review requested on latest commit.

#61

This PR fixes the issue which can occur when the method `getLatestVersion` of the `HasVersion` typeclass peeks the first element of the `VersionedBatch`.

In this case the stateful `ResultSet` inside this class moves forward and the first row of the set is being lost.

To avoid this issue, the `CanPeekHead` trait was added. The implementation of this trait saves the first row if the `ResultSet` if the head of the list was requested.
@s-vitaliy s-vitaliy requested a review from a team as a code owner November 8, 2024 08:40
@s-vitaliy s-vitaliy merged commit a577891 into scala Nov 8, 2024
2 checks passed
@s-vitaliy s-vitaliy deleted the fix-first-element branch November 8, 2024 10:43
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

Successfully merging this pull request may close these issues.

2 participants