Skip to content

Commit 1219287

Browse files
Fixed the reliability code quality issues
1 parent a6723ab commit 1219287

8 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/backend/api/api_routes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ async def batch_status_updates(
279279
try:
280280
await websocket.receive_text()
281281
except asyncio.TimeoutError:
282+
# TimeoutError is ignored to keep the WebSocket connection open without receiving data
282283
pass
283284

284285
except WebSocketDisconnect:

src/backend/common/services/batch_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ async def delete_batch(self, batch_id: UUID, user_id: str):
175175

176176
self.logger.info(f"Successfully deleted batch with ID: {batch_id}")
177177
return {"message": "Batch deleted successfully", "batch_id": str(batch_id)}
178+
else:
179+
return {"message": "Batch not found", "batch_id": str(batch_id)}
178180

179181
async def delete_file(self, file_id: UUID, user_id: str):
180182
"""Delete a file and its logs, and update batch file count."""

src/backend/sql_agents/helpers/comms_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ async def select_agent(self, agents, history):
7979
),
8080
None,
8181
)
82+
# No matching case found, so explicitly return None
83+
return None
8284

8385
# class for termination strategy
8486
class ApprovalTerminationStrategy(TerminationStrategy):

src/frontend/src/api/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ export const renderErrorSection = (batchSummary, expandedSections, setExpandedSe
414414

415415
export const renderErrorContent = (batchSummary) => {
416416
// Group errors by file
417-
const errorFiles = batchSummary.files.filter(file => file.error_count && file.error_count);
417+
const errorFiles = batchSummary.files.filter(file => file.error_count);
418418
if (errorFiles.length === 0) {
419419
return (
420420
<div className={useStyles().errorItem}>

src/frontend/src/pages/batchView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ const BatchStoryPage = () => {
349349
}
350350

351351
// Show the summary page when summary is selected
352-
if (selectedFile.id === "summary" && batchSummary) {
352+
if (selectedFile.id === "summary") {
353353
// Check if there are no errors and all files are processed successfully
354354
const noErrors = (batchSummary.error_count === 0);
355355
const allFilesProcessed = (batchSummary.completed_files === batchSummary.total_files);

src/frontend/src/pages/modernizationPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ useEffect(() => {
12441244
}
12451245

12461246
// Show the full summary page only when all files are completed and summary is selected
1247-
if (allFilesCompleted && selectedFile?.id === "summary") {
1247+
if (selectedFile?.id === "summary") {
12481248
const completedCount = files.filter(file => file.status === "completed" && file.file_result !== "error" && file.id !== "summary").length;
12491249
const totalCount = files.filter(file => file.id !== "summary").length;
12501250
const errorCount = selectedFile.errorCount || 0;

tests/e2e-test/pages/HomePage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class HomePage(BasePage):
1919
FILE_PROCESSED_MSG = "//span[normalize-space()='3 files processed successfully']"
2020

2121
def __init__(self, page):
22+
super().__init__(page)
2223
self.page = page
2324

2425
def validate_home_page(self):

tests/e2e-test/pages/loginPage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class LoginPage(BasePage):
1111
PERMISSION_ACCEPT_BUTTON = "//input[@type='submit']"
1212

1313
def __init__(self, page):
14+
super().__init__()
1415
self.page = page
1516

1617
def authenticate(self, username, password):

0 commit comments

Comments
 (0)