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

Handle network errors #403

Open
wants to merge 18 commits into
base: long-resp-handling
Choose a base branch
from
Open

Conversation

MrOrz
Copy link
Member

@MrOrz MrOrz commented Feb 23, 2025

In #401, we replaced the universal "Line bot is busy, or we cannot handle this message." timeout handling with a reply token collection mechanism.

However, it is possible that network errors occur so that the LINE client never gets the response back. Without proper error handling of network requests, the LINE user will wait indefinitely.

In this PR, we add back the error handling to long-running searchMedia() calls. When such error occurs, we would ask the user to try again later, which is a clear call-to-action message for the user.

圖片

Also, we add several logging labels to help debugging issues.

image

@coveralls
Copy link

coveralls commented Feb 23, 2025

Pull Request Test Coverage Report for Build 13481834874

Details

  • 12 of 18 (66.67%) changed or added relevant lines in 6 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 90.761%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/webhook/lineClient.js 0 1 0.0%
src/lib/gql.ts 3 5 60.0%
src/webhook/handlers/askingArticleSubmissionConsent.ts 0 3 0.0%
Files with Coverage Reduction New Missed Lines %
src/webhook/handlers/askingArticleSubmissionConsent.ts 1 87.69%
Totals Coverage Status
Change from base Build 13479682573: -0.2%
Covered Lines: 1129
Relevant Lines: 1199

💛 - Coveralls

@MrOrz MrOrz marked this pull request as ready for review February 23, 2025 04:49
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.

2 participants