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
I've been experimenting with the upload session API, and I think I've found a bug not covered by the current test cases.
commit=DropboxApi::Metadata::CommitInfo.new({"path"=>"/test.txt","mode"=>:add})# Upload the first three bytescursor=client.upload_session_start('abc')# Cursor offset has been correctly set to 3 at this pointexpect(cursor.offset).toeq(3)# Upload the second three bytesclient.upload_session_append_v2(cursor,'def')# Cursor offset *should* be set to 6 at this point, but remains 3# expect(cursor.offset).to eq(6)# Attempt to commit the uploadclient.upload_session_finish(cursor,commit)
This happens because the offset of the cursor never changes from 3 to 6 after the call to upload_session_append_v2.
This hack will cause the test to pass:
cursor=client.upload_session_start('abc')client.upload_session_append_v2(cursor,'def')# Manually update the offsetcursor.instance_variable_set(:@offset,6)client.upload_session_finish(cursor,commit)
There are test cases covering upload_session_append_v2 and upload_session_finish, but never the two together, which would otherwise reveal this problem.
I believe the correct behaviour is to have upload_session_append_v2 update the cursors offset after a successful request, and I'm working on a fix for this at the moment – let me know if you have any thoughts on this in the meantime.
The text was updated successfully, but these errors were encountered:
I've been experimenting with the upload session API, and I think I've found a bug not covered by the current test cases.
This raises an error:
This happens because the offset of the cursor never changes from 3 to 6 after the call to
upload_session_append_v2
.This hack will cause the test to pass:
There are test cases covering
upload_session_append_v2
andupload_session_finish
, but never the two together, which would otherwise reveal this problem.I believe the correct behaviour is to have
upload_session_append_v2
update the cursors offset after a successful request, and I'm working on a fix for this at the moment – let me know if you have any thoughts on this in the meantime.The text was updated successfully, but these errors were encountered: