mazed-dev / truthsayer

Second brain for knowledge workers that retains everything you read online and helps you to back up your communication with your source as easily as you might share an anecdote over a coffee.
MIT License
2 stars 2 forks source link

call Knocker.start() as non-blocking during init & release 0.6.31 #864

Closed SergNikitin closed 1 year ago

SergNikitin commented 1 year ago

To fix regression introduced in #795. This limits the impact auth.register() can have on extension startup. I'm not clear on why this happens, but this line

https://github.com/mazed-dev/truthsayer/blob/fbf4ea496e418ee76c3b5946c2abb1b4529841e4/smuggler-api/src/auth/knocker.ts#L122

can hang forever under certain circumstances.


I'm not sure why this became more problematic recently -- for me during local testing I can't pass auth.register() at all since a couple days ago and we had logs from Graham that exhibit similar behaviour at least on the surface. But I think I've started to notice a surge in time it takes to complete authorisation init step much earlier - up to 20 seconds in logs shared by others during the last month or so, which I think has the same root.