-
Notifications
You must be signed in to change notification settings - Fork 19
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(webhook): typing webhook request handler #356
Conversation
yhsiang
commented
Aug 11, 2023
•
edited
Loading
edited
- typing type of webhook event which is not found in the '@line/bot-sdk'
- typing context
@@ -187,8 +191,9 @@ const singleUserHandler = async ( | |||
return; | |||
} | |||
|
|||
input = postbackData.input; | |||
|
|||
const input = postbackData.input; |
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.
got this when running eslint:fix
193:5 error 'input' is never reassigned. Use 'const' instead
Pull Request Test Coverage Report for Build 5863817242
💛 - Coveralls |
createGreetingMessage(), | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore |
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.
As discussed on Slack we decided to create a new ticket for typing handlers/tutorial
and removing ts-ignore here.
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.
Seems that the root cause of many otherField as OOO
is that we separate type
from other fields.
We could have used discriminated union to properly narrow down the message type, but we somehow removed the discriminator (type
) from the otherField
, making narrowing impossible. We can merge this first and see if we can remove this otherField
together in the future.