Open cestoliv opened 2 years ago
This is not possible with the current request interface, blocked on https://github.com/matrix-org/matrix-js-sdk/issues/801
I tracked this down to 2 specific timeouts: https://github.com/matrix-org/matrix-js-sdk/blob/858155e0efc910e5e094803bb71af78d42419780/src/crypto/index.ts#L2037-L2040 and https://github.com/matrix-org/matrix-js-sdk/blob/858155e0efc910e5e094803bb71af78d42419780/src/http-api/utils.ts#L26-L28
As a workaround you can use pnpm patch to patch this package. Specifically in node, timers have an unref() method that tells node that its ok to end the process if the timer is still running.
I patched both of these setTimeout
like so:
setTimeout(....).unref();
and that allowed node to exit immediately after calling the stopClient()
method.
I am writing some Jest based integration tests and ran into this issue:
Jest did not exit 5 seconds after the test run has completed.
'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
Temporary workaround for anyone using Jest is to run it with the --forceExit
flag, so:
"scripts": {
...
"test": "jest --forceExit",
...
}
Hello, I am trying to use this module to send a notification at the end of a script. It works, except that the client only stops several minutes after calling the
.stopClient()
function. So my program is still awake during this time.The program blocks after
And finally after many minutes I get
Sync no longer running: exiting
and the program finally stops.How can I force the client (and the synchronization) to stop immediately?
Here is the code i'm using:
Full logs