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 choosing reply button expire #324

Merged
merged 3 commits into from Sep 21, 2022
Merged

Conversation

nonumpa
Copy link
Member

@nonumpa nonumpa commented Sep 19, 2022

Fix #323

Directly call the specific handler function when choosing article/reply for user

…ctions (handleInput, handlePostback and processImage)
Remove handlePostback mock, use choosingArticle and choosingReply api fixture instead
@nonumpa nonumpa requested a review from MrOrz September 19, 2022 18:10
@@ -70,10 +70,17 @@ export default async function({ data = {} }, event, userId) {

// choose for user
event = {
type: 'postback',
type: 'server_choose',
Copy link
Member

Choose a reason for hiding this comment

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

Question: what would happen if we just use 'postback' here?

Copy link
Member Author

Choose a reason for hiding this comment

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

No functional difference.

I use server_choose just to sperate two different flow : "user choose" and "server choose for user".

@MrOrz
Copy link
Member

MrOrz commented Sep 21, 2022

圖片

This can be reproduced on local machine using npm t -- --runInBand
圖片

@nonumpa nonumpa marked this pull request as ready for review September 21, 2022 05:22
Even though the function under test does not import MongoDB client, its dependency may do.
Therefore we just close DB connection for each test suite by adding DB closing logic in setup-jest.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3095429439

  • 5 of 5 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 91.543%

Totals Coverage Status
Change from base Build 3007617201: 0.02%
Covered Lines: 930
Relevant Lines: 996

💛 - Coveralls

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.

LGTM! Thanks for the fix 🙏

@MrOrz MrOrz merged commit 5dbdb74 into master Sep 21, 2022
@MrOrz MrOrz deleted the issue/232-reply-expire branch September 21, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button of choosing reply always expires
3 participants