Skip to content

Conversation

@svenseeberg
Copy link
Member

@svenseeberg svenseeberg commented Nov 24, 2025

Short description

In some cases the chat back runs into unexpected errors which usually only imply that no answer could be generated for the user. This PR catches the most important ones, logs them, and turns the typing indicator off, so that the user does not expect messages that will never come.

Proposed changes

  • Catch some more often occurring aiohttp errors and turn off typing indicator.

Side effects

  • None.

Faithfulness to issue description and design

This improves the UX as asked for in digitalfabrik/integreat-chat#362

How to test

Turn off chat back end and send message. The typing indicator should turn off before the 60s cache expires.

Resolved issues

Fixes: digitalfabrik/integreat-chat#362


Pull Request Review Guidelines

@svenseeberg svenseeberg force-pushed the feat/handle-chat-back-end-exceptions branch 3 times, most recently from b4148b3 to 92d23da Compare November 26, 2025 09:30
@svenseeberg svenseeberg marked this pull request as ready for review November 26, 2025 13:06
@svenseeberg svenseeberg force-pushed the feat/handle-chat-back-end-exceptions branch from 92d23da to 90816ab Compare December 1, 2025 09:29
aiohttp.client_exceptions.ServerDisconnectedError,
aiohttp.client_exceptions.ClientConnectionError,
):
logger.exception("Failed to get response from chat back end.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be helpful to log which exception was caught, maybe? But this also works for me 👍

Copy link
Member Author

@svenseeberg svenseeberg Dec 8, 2025

Choose a reason for hiding this comment

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

I think connection problems are usually very easy to debug and don't need the details. The message should be improved though:

Failed to get response from chat back end due to connection error.

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.

Set typing to false on error

4 participants