LargeFileUploadTask.resume() may update rangesRemaining but does not handle modifying the InputStream accordingly
还没有人认领这个 Issue。
评估
调研方向
首先定位 LargeFileUploadTask.resume()、updateSessionStatus() 和 upload(),然后跟踪重新创建的上传会话恢复后 rangesRemaining 和提供的 InputStream 是如何使用的。在 Android 上或等效测试中重现部分上传会话的场景;完成标准是恢复的上传使用正确的流位置,或在上传前明确公开更新后的范围。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe the problem.
I may be misunderstanding something about the SDK but her is my problem.
Im using Android and com.microsoft.graph:microsoft-graph:6.54.0. If I recreate an upload session where the LargeFileUploadTask had uploaded som of the file, and use it to recreate a LargeFileUploadTask and call resume() internally the SDK calls updateSessionStatus() and may update rangesRemaining. However it does not modify my provided InputStream based on this. So when it calls upload() and slices are later created for upload it uses the wrong data and the resulting file is corrupted.
I can not prepare the InputStream because I do not know what rangesRemaining is going to be (hence resume is asking the API) so the only way around it I can see is using updateSessionStatus() myself, adjust the InputStream and call upload() instead.
This works but is what I would assume the resume() function to handle.
Describe the solution you'd like.
It would be good if the resume function could handle the InputStream itself.
If that is not possible maybe provide some way, like a callback in resume(), where I get the new session with potentially new rangesRemaining and can modify my InputStream before the internal upload() call.
Or provide more information in the javadoc so future users do not run into the same wrong assumptions about InputStream handling I did.
Or remove/hide resume() removing the temptation to use it. It seams dangerous for it to ask the API for a new correct range with no way for the developer to act on it before uploading starts.
Additional context?
No response
- 主要语言
- Java
- 星标
- 444
- 派生
- 154
- 平均合并
- 18 小时 28 分钟
- 30 天内合并 PR
- 4
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoftgraph/msgraph-sdk-java 的其他 Issue
-
status:waiting-for-triage type:bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
-
status:waiting-for-triage type:bug
难度 3/5 1-2 天 新手友好度 55/100
microsoftgraph/msgraph-sdk-java#2656 ·
-
status:waiting-for-triage type:bug
难度 4/5 3-5 天 新手友好度 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
-
status:waiting-for-triage
难度 4/5 3-5 天 新手友好度 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
-
status:waiting-for-triage type:bug
难度 3/5 1-2 天 新手友好度 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 条评论 ·
查看 microsoftgraph/msgraph-sdk-java 的全部 Issue
相似的 Issue
-
Bug Java Platform: Java
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-java#6138 · 1 条评论 ·
-
bug needs triage p2
难度 2/5 1-3 小时 新手友好度 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug needs triage
难度 2/5 1-3 小时 新手友好度 76/100