Remove axios dependencies from ALIA UI#1830
Conversation
|
23dc53b to
d2e9157
Compare
d2e9157 to
90bdc9e
Compare
| "streaming-chatbot-service": "disabled", | ||
| }), | ||
| } as Response); | ||
| } |
There was a problem hiding this comment.
GET mock logic duplicated within mockFetchPost function
Low Severity
The mockFetchPost function duplicates the entire GET request handling logic from mockFetchGet (lines 13-25 in mockFetchGet are copied to lines 33-46 in mockFetchPost). This internal redundancy within the same file means changes to GET mock behavior require updates in two places, increasing risk of inconsistency.
Additional Locations (1)
| }); | ||
| return { pass, message }; | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Duplicated custom vitest matcher across test files
Low Severity
The objectStringContaining custom vitest matcher is identically duplicated in both aap_chatbot/src/App.test.tsx and ansible_ai_connect_chatbot/src/App.test.tsx. This matcher could be extracted to a shared test utilities file to reduce maintenance burden and ensure consistent behavior across both packages.
Additional Locations (1)
|



Jira Issue: https://issues.redhat.com/browse/AAP-60189
Assisted-by: Claude Code
Generated by: Claude Code
Description
Testing
Steps to test
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.4- Backport to stable-2.4 branchbackport/stable-2.5- Backport to stable-2.5 branchbackport/stable-2.6- Backport to stable-2.6 branchbackport/all- Backport to all active stable branchesno-backport- Explicitly mark as not needing backportBackport Justification
Special backport considerations:
Scenarios tested
Production deployment
Note
Medium Risk
Moderate risk because it changes core network/request behavior (timeouts, error detection, request payload formatting) and could subtly affect production API interactions despite tests being updated.
Overview
Replaces
axioswith the nativefetchAPI across both chatbot UIs, updating the chat request, feedback submission, and health-check calls (including adding anAbortController-based timeout for non-streaming chat and mapping timeout/429 error handling to fetch semantics).Removes the
axiosdependency from bothpackage.json/lockfiles, updates unit tests to mockglobal.fetchinstead of axios (including a new stringified-body matcher), and adds a small guard inReferencedDocumentsto safely handle non-arrayreferenced_documents.Written by Cursor Bugbot for commit b762993. This will update automatically on new commits. Configure here.