Skip to content
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 issue 157 replyToken empty #158

Merged
merged 1 commit into from Feb 29, 2020
Merged

Fix issue 157 replyToken empty #158

merged 1 commit into from Feb 29, 2020

Conversation

nonumpa
Copy link
Member

@nonumpa nonumpa commented Feb 28, 2020

Clear timeout function when return or when message replied.

Fixes bugs :
1.Unfollow event which doesn't have replyToken causes [LINE Client] 400: The request body has 1 error(s).
2.Follow event sends an extra message 不好意思!系統可能在忙線中,無法及時處理您傳的訊息。請稍等幾分鐘再試試看唷。 to user after timeout.
3.Previous button pressed(postback message) sends message 不好意思!系統可能在忙線中,無法及時處理您傳的訊息。請稍等幾分鐘再試試看唷。 to user after timeout.

@nonumpa nonumpa requested a review from MrOrz February 28, 2020 17:51
@nonumpa nonumpa linked an issue Feb 28, 2020 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Feb 28, 2020

Pull Request Test Coverage Report for Build 630

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.25%

Totals Coverage Status
Change from base Build 625: 0.0%
Covered Lines: 219
Relevant Lines: 225

💛 - Coveralls

@MrOrz MrOrz linked an issue Feb 29, 2020 that may be closed by this pull request
src/index.js Outdated
setTimeout(function() {
if (isReplied) return;

let timerId = setTimeout(function() {
Copy link
Member

Choose a reason for hiding this comment

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

We can declare const here because no one is going to mutate timerId.

Copy link
Member

@MrOrz MrOrz left a comment

Choose a reason for hiding this comment

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

Thank you @nonumpa for spotting this issue!

I think we are good to go. You can directly merge after changing timerId to const.

@nonumpa nonumpa merged commit 2e71c4b into dev Feb 29, 2020
@nonumpa nonumpa deleted the issue/157-empty-replytoken branch February 29, 2020 08:59
@MrOrz
Copy link
Member

MrOrz commented Feb 29, 2020

It is confirmed to be working on staging environment. Now deploying it to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants