Skip to content

Connection between client upload process and backend web-hooks #144

Open

Description

@mohamadrezza

Question
I’m using a backend where, in the pre-finish hook, I send a response back to the client (after the file has been written to MinIO). The client is supposed to perform a specific action after receiving this response. However, it seems that with this library, the client is not able to receive or read the response coming from the pre-finish hook.

Is there any solution or recommended approach for this?

Also, I’d appreciate an answer to this question as well:

When all chunks are uploaded from the client to the TUS server, which hook does the TUS server trigger: pre-create or pre-finish?

Does the completion of chunk upload from the client to the TUS server mean that the file is already fully written to the storage backend, or does that happen later?

Activity

  1. Acconut commented on Apr 25, 2026

    @Acconut
    Member

    tus-java-client doesn't have an API yet to expose response bodies to the caller. As far as I know, we don't consume the body for any response at the moment. This would be a good enhancement for the future, though. You try catching the HttpUrlConnection as explained in this example https://github.com/tus/tus-java-client#can-i-use-my-own-custom-sslsocketfactory. Maybe that allows you to get the response body.

    When all chunks are uploaded from the client to the TUS server, which hook does the TUS server trigger: pre-create or pre-finish?

    I assume you are referring to tusd here. When all data has been received and the upload is complete, tusd executed the pre-finish hook. pre-create, on the other hand, is run before an upload resource is created. See https://tus.github.io/tusd/advanced-topics/hooks/#list-of-available-hooks

    Does the completion of chunk upload from the client to the TUS server mean that the file is already fully written to the storage backend, or does that happen later?

    Tusd syncs all state to the selected storage backend as part of the request handling. It does not defer any such activity to background processes. When the client receives a 2XX on its last PATCH request, the uploaded data has been saved in the storage.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions