Skip to content

bug(storage): UploadOrResume completes when a chunk is cancelled or fails #473

Closed as not planned

Description

@fresh55

Found this while working on #470.

When a chunk after the first one is cancelled or fails, UploadOrResume completes normally, but the file is only partly uploaded.

var cts = new CancellationTokenSource();
await storage.From("bucket").UploadOrResume(data, "a.bin", options, (_, _) => cts.Cancel(), cts.Token);
// completes after the first 6 MB chunk, the rest is never sent

A timeout or network error on a later chunk does the same. If it fails before the first chunk is sent (cancel, timeout, connection refused), it throws a NullReferenceException instead of the real error.

BirdMessenger's TusPatchWithChunkAsync catches every exception, passes it to OnFailedAsync and returns the last response it got. ResumableUploadAsync sets OnFailedAsync to a no-op and only checks that response, so it sees the previous chunk's 204, or null.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions