You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ui): UI needs hard page refresh to update apps
Fixesargoproj#9247
Root Cause:
The issue was caused by incorrect error handling in the EventSource connection and improper ordering of RxJS operators. Specifically:
1. The EventSource error handler in requests.ts was incorrectly defined as a function that returns another function, which prevented proper error handling and reconnection when the connection was lost.
2. The RxJS operators in applications-service.ts were not ordered optimally, causing issues with retry behavior and reconnection attempts.
3. The application list loading in applications-list.tsx was mutating the original applications array directly, which could lead to inconsistent state updates.
4. The application details page in application-details.tsx had unnecessary repeat and retry operators that were causing issues with the WebSocket connection.
Changes Made:
1. Fixed the EventSource error handler in requests.ts to be a direct function that handles errors properly.
2. Improved the retry logic in applications-service.ts by reordering the RxJS operators and adding a delay parameter to prevent rapid reconnection attempts.
3. Enhanced the application list loading in applications-list.tsx by creating a copy of the applications array and adding better handling for empty update batches.
4. Fixed the application details page in application-details.tsx by removing unnecessary operators and simplifying the stream handling.
Added comprehensive tests for all modified components to ensure the fix works correctly and prevent regression.
These changes ensure that the UI properly reconnects when the WebSocket connection is lost and that updates are properly propagated to the UI without requiring a hard page refresh.
This fix addresses a core UI functionality issue and should be considered for cherry-picking into older releases.
Checklist:
- [x] Fixed EventSource error handler in requests.ts
- [x] Improved retry logic in applications-service.ts
- [x] Enhanced application list loading in applications-list.tsx
- [x] Fixed application details page in application-details.tsx
- [x] Added comprehensive tests for all modified components
- [x] Fixed TypeScript errors and linting issues
- [x] Ensured code follows project style guidelines
- [x] Verified the fix works correctly in local testing
Signed-off-by: Marcus Bergo <[email protected]>
0 commit comments