Skip to content

Conversation

UtkarshMishra-Microsoft
Copy link
Contributor

@UtkarshMishra-Microsoft UtkarshMishra-Microsoft commented Sep 11, 2025

Purpose

  • ...
    This pull request improves error handling and robustness in the document section generation workflow for the Draft Documents feature. The main changes ensure that unexpected backend responses (such as non-JSON or error status codes) are correctly handled and surfaced to the user, preventing UI inconsistencies and improving debugging. The changes also streamline the asynchronous logic for generating section content and ensure overlays are closed reliably.

Error handling and backend response robustness:

  • Improved error logging and handling in documentSectionGenerate to log HTTP errors with status and status text for failed requests.
  • In ResearchTopicCard, added explicit checks for missing or rejected backend responses, with clear error messages and UI feedback for bad requests or non-JSON responses.
  • In both ResearchTopicCard and Card, added try/catch logic to handle unexpected non-JSON responses, ensuring that errors do not hide previous failures and that the UI remains responsive.

UI and workflow improvements:

  • In ResearchTopicCard, reset error state at the start of a generation run and ensured overlays are always closed after generation, regardless of success or failure.
  • In Card, moved loading state reset to a finally block to guarantee UI updates after section generation attempts, even if errors occur.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

@Roopan-Microsoft Roopan-Microsoft merged commit 82fcc89 into byoc-researcher Sep 17, 2025
5 checks passed
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