Open jcaesar opened 5 years ago
Right, I remember writing this too fast & loose... I don't have a synapse instance stood up for testing at this time, but let me see if I can contribute to the critical path:
According to https://github.com/matrix-org/matrix-js-sdk/blob/ae85c209ab0d58c900bc3db1802cffc1be880b85/spec/integ/matrix-client-event-emitter.spec.js#L304 the matrix client will emit Session.logged_out
in in the case of M_UNKNOWN_TOKEN
so that may be a good place to reject()
if we have not already resolve()
d.
If the matrix client fails its sync (for example with an
M_UNKNOWN_TOKEN
because of a configuration error) there will be no output at all, just a stale promise. The critical place should be instartClient
.This should be really simple (give some log output + fail the promise), but since I know near-nothing about nodejs, I don't dare make a PR.