balena-io-experimental / meetbot

A Google Meet bot to make meetings frictionless
GNU Affero General Public License v3.0
31 stars 13 forks source link

Replace `end` event with `error` #68

Closed 20k-ultra closed 2 years ago

20k-ultra commented 2 years ago

Make this event an error makes it more clear that this event was not suppose to happen. I also removed the double end event being emitted since the finally will always run after the catch. It's possible then that the manager does not know a bot terminated if the try block exits without an error. However, I think the bot should be explicitly emitting an event when it leaves willingly.

Here's an example of the error being catch and logged + bot being removed from active bot list.

Initializing meetbot service...
Listening for requests on port 8080
Current bot queue size: 1
typing out email
Unrecoverable bot error occured:  waiting for selector `input[type="emailbruhhh"]` failed: timeout 30000ms exceeded
Removing https://meet.google.com/eaa-ewrq-gdn from active bot queue
20k-ultra commented 2 years ago

@balena-ci I self-certify!

edit: forget CI doesn't work here

20k-ultra commented 2 years ago

superseded by https://github.com/balena-io-playground/meetbot/pull/69