microsoftgraph / microsoftgraph/msgraph-sdk-java
LargeFileUploadTask.resume() may update rangesRemaining but does not handle modifying the InputStream accordingly
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 444
- Forks
- 154
- Ø Merge
- 18 Std. 28 Min.
- Gemergte PRs (30 T.)
- 4
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, LargeFileUploadTask.resume(), updateSessionStatus() und upload() zu lokalisieren, und verfolge dann, wie rangesRemaining und der bereitgestellte InputStream verwendet werden, nachdem eine neu erstellte Upload-Sitzung fortgesetzt wurde. Reproduziere das Szenario einer teilweise hochgeladenen Sitzung auf Android oder in einem gleichwertigen Test; abgeschlossen ist die Aufgabe, wenn fortgesetzte Uploads die korrekte Stream-Position verwenden oder die aktualisierten Bereiche vor dem Upload eindeutig offenlegen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100