matrix-org / matrix-appservice-gitter

Matrix <-> Gitter bridge
Apache License 2.0
41 stars 12 forks source link

Don't rejoin rooms we are in on startup. #62

Closed Half-Shot closed 6 years ago

Half-Shot commented 6 years ago

The reason for this is we are allowed about 100 calls per minute and on startup we currently hammer the API with calls to join rooms we are in. This PR fetches the list and then skips the join logic.

This PR isn't as elegant as I'd like, e.g. the only way you can get a subscribable room object from node-gitter is by making an API call to get a single room, fetching the list doesn't give us proper objects. Therefore I am fetching the Room class straight from the source files and passing in the parameters myself. This is obviously evil, but it's that or making tons of unnecessary calls.

lukebarnard1 commented 6 years ago

(https://github.com/matrix-org/matrix-appservice-gitter/pull/62#discussion_r198840469)

thanks for hiding that gh..

Half-Shot commented 6 years ago

Are we :tada: now? :)

lukebarnard1 commented 6 years ago

I'm not seeing a comment on doing the two things in parallel. Am I missing something?

Half-Shot commented 6 years ago

Nope, I thought I had written it but I had not.