Skip to content

fix: code quality improvements#3649

Merged
MarkusNeusinger merged 5 commits intomainfrom
fix/code-quality-refactor
Jan 11, 2026
Merged

fix: code quality improvements#3649
MarkusNeusinger merged 5 commits intomainfrom
fix/code-quality-refactor

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

  • Fixed incorrect await on SQLAlchemy delete() calls
  • Extracted duplicate Claude prompts from workflows to prompts/workflow-prompts/
  • Added React ErrorBoundary component
  • Fixed test warnings for unawaited coroutines
  • Removed deprecated prompt files

Changes

  • core/database/repositories.py - Remove await from sync delete()
  • app/src/components/ErrorBoundary.tsx - New component
  • app/src/router.tsx - Wrap with ErrorBoundary
  • .github/workflows/impl-generate.yml - Use external prompt file
  • .github/workflows/impl-repair.yml - Use external prompt file
  • prompts/workflow-prompts/impl-generate-claude.md - New
  • prompts/workflow-prompts/impl-repair-claude.md - New
  • tests/unit/api/test_analytics.py - Fix coroutine warnings

Test plan

  • 848 unit tests pass
  • Lint/format checks pass
  • Frontend builds successfully
  • YAML syntax validated

🤖 Generated with Claude Code

- Remove incorrect await on SQLAlchemy delete() (repositories.py)
- Extract duplicate workflow prompts to dedicated files
- Add ErrorBoundary component to React frontend
- Fix test warnings for unawaited coroutines
- Delete deprecated prompt files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 10, 2026 23:50
- Enhance project documentation for better understanding
- Introduce ErrorBoundary component for error handling in React
- Refactor repository methods to remove unnecessary await
- Update test cases to improve clarity and maintainability
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves code quality across multiple areas: fixes incorrect async/await usage in SQLAlchemy repositories, eliminates test warnings, adds error handling to the React frontend, and reduces duplication in GitHub workflows.

Changes:

  • Fixed bug where SQLAlchemy's synchronous delete() method was incorrectly awaited
  • Added proper coroutine cleanup in unit tests to eliminate pytest warnings
  • Introduced React ErrorBoundary component for graceful error handling
  • Refactored GitHub workflows to use centralized prompt files, eliminating ~200 lines of duplication

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
core/database/repositories.py Removed incorrect await from synchronous session.delete() calls in three repository classes
tests/unit/api/test_analytics.py Added mock_create_task fixture that properly closes coroutines to fix pytest warnings
app/src/components/ErrorBoundary.tsx New React component for catching rendering errors with user-friendly recovery UI
app/src/router.tsx Wrapped application with ErrorBoundary for top-level error handling
.github/workflows/impl-generate.yml Replaced ~70 lines of inline prompt with reference to external file
.github/workflows/impl-repair.yml Replaced ~70 lines of inline prompt with reference to external file
prompts/workflow-prompts/impl-generate-claude.md New centralized prompt file for implementation generation
prompts/workflow-prompts/impl-repair-claude.md New centralized prompt file for implementation repair
prompts/workflow-prompts/improve-from-feedback.md Removed deprecated prompt file
prompts/workflow-prompts/generate-implementation.md Removed deprecated prompt file

Comment on lines +42 to +44
handleRetry = (): void => {
this.setState({ hasError: false, error: null });
};
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The handleRetry method is defined but never used. It should either be connected to a button in the UI or removed to avoid dead code.

Copilot uses AI. Check for mistakes.
MarkusNeusinger and others added 2 commits January 11, 2026 00:56
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add "Try Again" button that calls handleRetry to reset error state
without a full page reload. Addresses Copilot review comment about
unused method.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 10, 2026 23:58
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Fixes 3 security vulnerabilities:
- CVE: XSS via Open Redirects (high)
- CVE: SSR XSS in ScrollRestoration (high)
- CVE: CSRF in Action/Server Action Request Processing (medium)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

@@ -0,0 +1,131 @@
import { Component, ReactNode } from 'react';
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing React import. The code uses React.ErrorInfo on line 31 but only imports Component and ReactNode from 'react'. Add import React or change line 31 to use a direct import of ErrorInfo type.

Copilot uses AI. Check for mistakes.
@MarkusNeusinger MarkusNeusinger merged commit b9ded83 into main Jan 11, 2026
6 checks passed
@MarkusNeusinger MarkusNeusinger deleted the fix/code-quality-refactor branch January 11, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants