Uppy / Tus is reporting the same error twice

I am using a TUS backend.

When trying to capture the error using uppy.on("upload-error"). upload-error is emitted twice for the same error, while we expect uppy to only report the error once.

Once here - link to uppy code:

uploadOptions.onError = (err) => {
        this.uppy.log(err)

        const xhr =
          (err as tus.DetailedError).originalRequest != null ?
            (err as tus.DetailedError).originalRequest.getUnderlyingObject()
          : null
        if (isNetworkError(xhr)) {
          // eslint-disable-next-line no-param-reassign
          err = new NetworkError(err, xhr)
        }

        this.resetUploaderReferences(file.id)
        queuedRequest?.abort()

        this.uppy.emit('upload-error', file, err)
        if (typeof opts.onError === 'function') {
          opts.onError(err)
        }
        reject(err)
      }

and once here - link to uppy code:

    }).catch((err) => {
      this.uppy.emit('upload-error', file, err)
      throw err
    })

Here is the link to relevent code on Zulip open source project.

First error traceback

Same error but the logged second time:

Here is a reproducer - Uppy Dashboard (forked) - StackBlitz

You can notice the double logged errors after the retry attempts are finished.

Should I open a bug report for this?

Thank you for reporting this. Can you please open an issue in the Uppy repository for this?

Opened issue #5473 on GitHub. Can’t link it here.

The issue is at Duplicate error emitted when receiving an error from the TUS server. · Issue #5473 · transloadit/uppy · GitHub. We’ll look into it!