[GODRIVER-1806] DownloadStream.Skip() does not handle multiple chunks correctly Created: 03/Dec/20  Updated: 28/Oct/23  Resolved: 14/Jan/21

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.4.5, 1.4.6

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

DownloadStream.Skip() does not seem to skip correctly when iterating over multiple chunks. The test cases here identify two cases:

https://play.golang.org/p/z7RDRqU01ZA

1. Skipping less than chunk size if the buffer offset is 0 results in a no-op.
2. When skipping results in the buffer offset being divisible by the chunk size on the last loop iteration in Skip, it resets the offset but does not fill the next buffer.



 Comments   
Comment by Githook User [ 01/Feb/21 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: GODRIVER-1806 Fix and test DownloadStream.Skip() (#557)
Branch: release/1.4
https://github.com/mongodb/mongo-go-driver/commit/a05892574280bada1cf82c5ff88464d5a6651905

Comment by Githook User [ 14/Jan/21 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: GODRIVER-1806 Fix and test DownloadStream.Skip() (#557)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/cc85d3210f49d9daef608a2c61cdd3f490514e9a

Comment by Kevin Albertson [ 05/Jan/21 ]

PR: https://github.com/mongodb/mongo-go-driver/pull/557

Comment by Githook User [ 09/Dec/20 ]

Author:

{'name': 'ginuerzh', 'email': 'ginuerzh@users.noreply.github.com', 'username': 'ginuerzh'}

Message: GODRIVER-1806 Fix wrong conditional in DownloadStream.Skip (#542)
Branch: release/1.4
https://github.com/mongodb/mongo-go-driver/commit/bcc33862008437e3ad976be5b0dbf2dd9f64ea2e

Comment by Githook User [ 09/Dec/20 ]

Author:

{'name': 'ginuerzh', 'email': 'ginuerzh@users.noreply.github.com', 'username': 'ginuerzh'}

Message: GODRIVER-1806 Fix wrong conditional in DownloadStream.Skip (#542)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/b88a5d79eb92272703073063673d3c777c4e81f4

Comment by Kevin Albertson [ 03/Dec/20 ]

I believe https://github.com/mongodb/mongo-go-driver/pull/542 fixes case 1. I think we should merge it, fix the other case, and add tests.

Generated at Thu Feb 08 08:37:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.