Skip to content

Conversation

ron-42
Copy link

@ron-42 ron-42 commented Oct 16, 2025

Description

Refactors frontend/src/conversation/conversationHandlers.ts from legacy .then() chaining to modern async/await syntax for improved code maintainability and readability.

Fixes #2070

Changes Made

Refactored Functions (7 total):

  • handleFetchAnswer - Main answer fetching handler
  • handleFetchAnswerSteaming - Streaming response handler
  • handleSearch - Document search handler
  • handleSearchViaApiKey - API key-based search handler
  • handleSendFeedback - User feedback submission handler
  • handleFetchSharedAnswerStreaming - Shared conversation streaming handler
  • handleFetchSharedAnswer - Shared conversation answer handler

Key Improvements:

  • 🔄 Replaced .then() chains with async/await for linear, readable code flow
  • ✅ Improved error handling using try/catch blocks instead of .catch()
  • 🎯 Maintained exact same functionality and return types (no breaking changes)
  • 📝 Added missing toolCalls type to handleFetchSharedAnswer return type
  • 🧹 Cleaner error propagation with direct throw statements

Testing

  • ✅ TypeScript compilation passes with no errors
  • ✅ ESLint validation passes
  • ✅ Manual testing completed:
    • Basic Q&A functionality works correctly
    • Streaming responses render properly
    • Document search operates as expected
    • Feedback submission successful
    • Shared conversations with API keys functional
    • Multiple document selection works
    • File attachments handled correctly
  • ✅ No breaking changes - all existing functionality preserved

Code Quality

  • Follows modern JavaScript/TypeScript best practices
  • Maintains consistency with the rest of the codebase
  • No changes to function signatures or public APIs
  • Backward compatible with all existing code

Type of Change

  • Refactoring (no functional changes, code improvement)
  • Code quality improvement

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have tested my changes locally
  • My changes generate no new warnings or errors
  • No breaking changes introduced

Copy link

vercel bot commented Oct 16, 2025

@ron-42 is attempting to deploy a commit to the Arc53 Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Oct 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
oss-docsgpt Ready Ready Preview Comment Oct 17, 2025 3:30pm

Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.27%. Comparing base (498e2b7) to head (f117527).
⚠️ Report is 91 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2072      +/-   ##
==========================================
+ Coverage   34.67%   39.27%   +4.59%     
==========================================
  Files         131      135       +4     
  Lines        8703     9296     +593     
==========================================
+ Hits         3018     3651     +633     
+ Misses       5685     5645      -40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Use async/await instead

1 participant