-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(App): Can't catch async errors from singleAuthorization
.
#837
Conversation
Codecov Report
@@ Coverage Diff @@
## main #837 +/- ##
==========================================
+ Coverage 66.05% 66.16% +0.11%
==========================================
Files 13 13
Lines 1193 1200 +7
Branches 351 354 +3
==========================================
+ Hits 788 794 +6
- Misses 336 338 +2
+ Partials 69 68 -1
Continue to review full report at Codecov.
|
Hey @Awalgawe, Thanks for sending the PR! Could you provide a reproduction usecase for the issue? |
Hi @stevengill It arrives when you use a bot token & accidently delete your bot ! ^^' |
we had something like: try {
new App({
token: 'myToken',
signingSecret: 'MySecret',
});
} catch (error) {
// nop
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check the behavior later but can you share error details illustrating the behavior changes and/or write some tests verifying if it works as expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test cases you've added do not fail with the current implementation.
@Awalgawe Before discussing the details of your solution, your test code does not fail even with the current implementation. The added tests seem to be unrelated with the following situation you've mentioned: try {
new App({
token: 'myToken',
signingSecret: 'MySecret',
});
} catch (error) {
// nop
} Your test code is trying to verify some patterns with |
@seratch Before my fix, the async error was throwed from the sync context of the App constructor: the previous version of the code create a promise in |
@Awalgawe Thanks for sharing more details! At this moment, early failure of Just for reference, We are planning to add a flag to customize the timing of first API call. #718. We have been receiving requests like "I don't want to have the |
Oh ok, I didn't expect that after reading the code.
On this part, we have numerous ways to make it not breaking. I'll try something. |
@seratch any comments on new commits ? |
@Awalgawe Oh, you've changed the direction of this pull request and you're trying to implement tokenVerificationEnabled option. That's great! However, as I didn't hear from you, I've implemented the feature at #863 a few days ago. If you have feedback on |
As #863 can be a solution for your use case, let us close this pull request now. Thanks again for taking the time to make this pull request! |
Summary
In
singleAuthorization
, errors fromclient.auth.test
can't be catched.Requirements (place an
x
in each[ ]
)