microsoftgraph / microsoftgraph/msgraph-sdk-java

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

Abierto
#2,503 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

status:waiting-for-triage type:feature
Lenguaje dominante
Java
Estrellas
444
Forks
154
Merge medio
18 h 28 min
PR fusionados (30 d)
4

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza localizando LargeFileUploadTask.resume(), updateSessionStatus() y upload(), y luego sigue cómo se usan rangesRemaining y el InputStream proporcionado después de reanudar una sesión de carga recreada. Reproduce el escenario de una sesión cargada parcialmente en Android o en una prueba equivalente; se considera terminado cuando las cargas reanudadas usan la posición correcta del flujo o exponen claramente los rangos actualizados antes de cargar.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
api
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.