Skip to content

Ensure chunks are not passed to DuoChat when full message arrived

Jannik Lehmann requested to merge jnnkl-empty-error-response-fix into master

What does this MR do and why?

This merge request fixes a bug in DuoChat where, under certain network conditions, an answer would stream in and then be erased from the UI, resulting in an empty message. Issue: #457756 (closed)

What was the problem?

There are two GraphQL Subscriptions on the same query involved: one for streaming the answer and one for the final answer. The bug occurred when the final answer Subscription returned a result before the last chunk was streamed in. This caused the answer to be erased and replaced with an empty message.

What is the fix?

The fix involves introducing an additional check for the requestId. This ensures that once the complete answer has arrived, no more streaming results are added for that request.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Demo of bug before fix
2024-04-22_22-18-31

How to set up and validate locally

Proving or testing the non-existence of an inconsistent bug is challenging. Additionally, mocking the network conditions under which this bug appeared is not trivial.

I recommend performing manual testing and reviewing the provided unit tests that cover the relevant conditions.

Edited by Jannik Lehmann

Merge request reports