Fix duplicated message issue with switching tabs while streaming#1814
Merged
TamiTakamiya merged 2 commits intomainfrom Jan 19, 2026
Merged
Conversation
romartin
reviewed
Jan 15, 2026
Contributor
romartin
left a comment
There was a problem hiding this comment.
That's great, thanks @TamiTakamiya ! <3
BTW Is it possible to write some test that ensures the openWhenHidden parameter being set?
Contributor
Author
Thank you for your comment. I added a test case, which was generated by Claude Code. Could you take a look again? |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Jira Issue: https://issues.redhat.com/browse/AAP-62685
Note: Test case was generated by Claude Code.
Description
Fix the issue that generates duplicated messages if user switches browser tabs while chatbot response has not fully received in the streaming mode. See the Jira ticket for more details.
Testing
Steps to test
For manual test using source codes extracted from this PR, see the instructions documented here.
Type of Change
Backport Policy
This change should be:
Automated Backport Instructions
After this PR is merged, add one or more labels to automatically create backport PRs:
backport/stable-2.6- Backport to stable-2.6 branchBackport Justification
It's a high severity bug and the fix should be very safe.
Special backport considerations:
We need to have a new npm package and update aap-ui repository to pick up the updated npm package.
Scenarios tested
Unit tests and manual tests.
Production deployment
Note
Prevents duplicate chatbot responses during streaming when the browser tab becomes hidden.
openWhenHidden: trueto streamingfetchEventSourceoptions inuseChatbot.ts(bothaap_chatbotandansible_ai_connect_chatbot)0.1.8Written by Cursor Bugbot for commit efb646e. This will update automatically on new commits. Configure here.