Skip to content

Conversation

Zabuzard
Copy link
Member

@Zabuzard Zabuzard commented Jul 9, 2022

Overview

This is an attempt to fix the current, frequent, bug where help threads are missing the bot explanation messages.

Explanation

They are caused by an exception:

exception

The source of this is most likely that overviewChannel.createThreadChannel(...) is rate limitted and hence executed a few seconds later. At which point the subsequent event.refer(...) crashes with Unknown interaction cause it is past the 3 seconds threshold. The extra messages are then missing, cause they are flatMap'ed right after the failing notifyUser(...):

code

Solution

The solution introduced in this PR is to simply make the whole interaction deferred. That way, the code has more time to respond, enough to fit in a delayed thread creation - hopefully.

There are also other alternatives available, such as changing the order of the statements or simply not letting the chain collapse on a single failure. But I would like to try out this fix first.

@Zabuzard Zabuzard added bug Something isn't working priority: normal labels Jul 9, 2022
@Zabuzard Zabuzard self-assigned this Jul 9, 2022
@Zabuzard Zabuzard requested review from a team as code owners July 9, 2022 13:19
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@illuminator3 illuminator3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Zabuzard
Copy link
Member Author

Week old, one approval, merging.

@Zabuzard Zabuzard merged commit ea59cf1 into develop Jul 18, 2022
@Zabuzard Zabuzard deleted the bugfix/create_thread_is_rate_limitted branch July 18, 2022 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants