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(docstore/awsdynamodb): ensure Next returns EOF when no more items #3406

Merged
merged 1 commit into from Mar 21, 2024

Conversation

bartventer
Copy link
Contributor

Fixes #3405

Although I was unable to reproduce the panic, I added a preventive check for awsdynamodb here. This check returns io.EOF if there are no more items, which should prevent an index out of range panic when Next is called after it has already returned EOF once.

I also added a test case to verify this behavior. The test repeatedly calls Next until it gets io.EOF, then calls Next again to ensure it still returns io.EOF.

I also generated new replay files for awsdynamodb and gcpfirestore.

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 73.12%. Comparing base (1f3e996) to head (daa25e8).

Files Patch % Lines
docstore/awsdynamodb/query.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3406      +/-   ##
==========================================
- Coverage   73.13%   73.12%   -0.01%     
==========================================
  Files         113      113              
  Lines       14862    14864       +2     
==========================================
  Hits        10870    10870              
- Misses       3218     3219       +1     
- Partials      774      775       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vangent vangent merged commit c3b220a into google:master Mar 21, 2024
5 checks passed
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.

docstore/awsdynamodb panics on iter.Next()
2 participants