#Uncancellable Event

3 messages · Page 1 of 1 (latest)

static zenith
#

Hi all,
I need to run a token refresh operation, which if it gets interrupted (by an HTTP cancel for example) would corrupt my tokens. Is there anyway in NestJS to have a promise / callback which can't be HTTP cancelled?

Maybe I'm looking for a work queue which could take a callback that is not tied to the requests lifetime. I have been trying to implement this with RXJS through returning an exhaust map of my operation, but it's still cancellable.

carmine island
#

A regular promise can't be cancelled, what's the issue you're having?

static zenith
#

I have an observable that does the token rotation, then it RXJS maps that result into a call to the DB to write it.

I'm seeing that if someone issues an HTTP cancel (by leaving the page) it can cancel this request during the token rotation. Therefore the new token is never written.