Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retains HTTP Context values #455

Closed
wants to merge 2 commits into from
Closed

Conversation

bastien-seqone
Copy link

@bastien-seqone bastien-seqone commented Jan 19, 2021

As discussed in #443, revival of the pull request #342 , to which I have added a unit test as requested in the comments.

The unit test ensure that value in request context is accessible in datastore. The original PR is a Copypasta of @Acconut solution to #315 by @innovate-invent

I rebase previous PR onto master.

It could solve issues #443, and related to #361 and #309.

@bastien-seqone bastien-seqone changed the title Context Retains HTTP Context values Jan 19, 2021
@iamralch
Copy link

Any plans this PR to be accepted?

@pcfreak30
Copy link

Ive just ran into this issue as well. Im delegating to tusd Handler from the iris framework which has to do auth via a jwt middleware, and need to ensure the tus store is aware of the auth state data via context to save to the database properly.

Given the current situation, will likely have to fork.

@Acconut
Copy link
Member

Acconut commented Jul 3, 2023

I somehow forgot this PR, but I will revisit it soon. Thanks for reminding me.

@NickNeedsAName
Copy link

ping

This seems to be the "go" way to do things. Is there a reason to not use the request context when doing things?

@Acconut
Copy link
Member

Acconut commented Aug 11, 2023

Is there a reason to not use the request context when doing things?

The request context is cancelled if the request is aborted. But we want to continue performing tasks after the request is aborted, such as saving the last received bytes to S3. This cannot be done if we use the request context.

@Acconut
Copy link
Member

Acconut commented Aug 23, 2023

Thanks you for your contribution! In tusd v2, the request context will be accessible in the hooks and stores. Please see #986 for more details and #672 for the development of v2.

@Acconut Acconut closed this Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants