-
Notifications
You must be signed in to change notification settings - Fork 61
Config/context overridden by another webhook #732
Comments
/start |
Tips:
|
@whilefoo could you please link the file where we have the global variables and where we are using them? |
https://github.com/ubiquity/ubiquibot/blob/development/src/bindings/event.ts#L11-L16 Also adapters are initialized on every event which doesn't make sense because they are not dependant on the event or config and always stay the same, so it would be better to initialize them only once when the bot starts up. |
export interface BotContext extends Context {
botConfig: BotConfig;
} I made this interface and passed it as an argument in |
Can you create PR even if it's failing, then I can help you out |
done, thanks |
Do you have any updates @Sadaf-A? If you would like to release the bounty back to the DevPool, please comment |
/stop |
You have been unassigned from the bounty @Sadaf-A |
@whileoo please let me know when you are available till then I will try to work on something else! |
/start |
Tips:
|
Do you have any updates @Sadaf-A? If you would like to release the bounty back to the DevPool, please comment |
@Sadaf-A - Releasing the bounty back to dev pool because the allocated duration already ended! |
/start |
Skipping |
/assign |
@pavlovcik @whilefoo did something change in the bot how should i assign myself? |
/start |
Skipping |
@whilefoo @pavlovcik I've resolved all the errors in my PR could you please assign me. I don't know why the bot is not able to do so. Thank you. |
This was addressed but @whilefoo on my refactor pull request. Because my pull request is addressing basically all the immediate needs of the bot, and because it's such a huge change to the codebase, I decided to disable public tasks in this repository until it's merged in which I expect to be next week sometime. |
could you manually assign me for now? |
/start |
Skipping |
hey any update? |
/start |
Skipping |
/start |
Skipping |
I realized that bot config and context are global variables and when the bot runs and multiple webhooks are received at the same time, it will cause for one of them to override the other one. This is especially bad when the two webhooks are from two different repositories because a lot of functions use context to get repository and owner. Now because we are running the bot as Netlify function on production, as far as I know it runs the whole script as a separate process for every request so that avoid the problem. But if we run the bot as one process like during development then this will cause problems.
As I'm writing this I remember one case where an issue was created with 2 labels so Github sent 3 webhooks, one for issue opened and two for labels. The two webhooks for labels were exactly the same, which I thought was weird at first but in the end I thought this was Github's problem. Now it all makes sense!
Conclusion:
We should avoid using global variables, so context and bot config should be passed down by parameters which I know is more verbose but it's the only solution I can think of right now. If anyone has any suggestions, please comment.
The text was updated successfully, but these errors were encountered: