microsoftgraph / microsoftgraph/msgraph-sdk-java

LargeFileUploadTask.resume() may update rangesRemaining but does not handle modifying the InputStream accordingly

未关闭
#2,503 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

status:waiting-for-triage type:feature
主要语言
Java
星标
444
派生
154
平均合并
18 小时 28 分钟
30 天内合并 PR
4

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先定位 LargeFileUploadTask.resume()、updateSessionStatus() 和 upload(),然后跟踪重新创建的上传会话恢复后 rangesRemaining 和提供的 InputStream 是如何使用的。在 Android 上或等效测试中重现部分上传会话的场景;完成标准是恢复的上传使用正确的流位置,或在上传前明确公开更新后的范围。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
api
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。