-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Events not being triggered #3661
Comments
Just tested this in e2e and it works. Not sure how to reproduce or if this is actually an issue? it.only('should emit events when JWT token is expired', () => {
cy.get('@file-input').attachFile(['images/cat.jpg', 'images/traffic.jpg'])
const error = cy.spy()
const uploadError = cy.spy()
cy.window().then(({ uppy }) => {
uppy.on('upload-error', uploadError)
uppy.on('error', error)
})
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.intercept(
{ method: 'POST', pathname: '/files', times: 1 },
{ statusCode: 401, body: { code: 401, message: 'Expired JWT Token' } },
).as('patch')
cy.wait('@patch').then(() => {
expect(error).to.be.called
expect(uploadError).to.be.called
})
}) |
Hi Murderlon, Thank you kindly for looking into this so promptly and many apologies for wasting your time! It would appear that the issue I was having was caused by caches. I cleared the Metro cache and the events started working without a glitch. On a separate note, I noticed that the I applied a patch locally to also get the Thanks! |
I'm closing this then but PRs would be welcome for a potential fix of the response! Thanks |
I'm running into something which I believe could be a bug.
I am trying to implement Uppy and
tus
in a React Native application. The back-end implements JWT authentication, with access and refresh tokens.As recommended in this comment, I am trying to rely on events to determine whether the back-back end responds with HTTP 401 so that I can attempt to renew the access token.
The bug appears to be that events are not firing. I presume it's all of them, but I know for certain that
error
andupload error
have no effect.My implementation looks something like this:
I've set a 10 second TTL for access tokens to ensure that by the time I attempt the upload, the token is definitely expired.
As
debug
is set totrue
, I am receiving these messages in the console:Thanks!
The text was updated successfully, but these errors were encountered: