Skip to content

feat: merging dev to main - #656

Merged
Roopan-Microsoft merged 9 commits into
mainfrom
dev
Jun 8, 2026
Merged

feat: merging dev to main#656
Roopan-Microsoft merged 9 commits into
mainfrom
dev

Conversation

@Ayaz-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

This pull request introduces several improvements across the backend and frontend, focusing on code safety, maintainability, and minor bug fixes. The most significant changes include enhanced exception handling to prevent telemetry and logging failures from impacting application flow, improved immutability and code clarity, and some targeted bug fixes in document processing and repository logic.

Exception Handling & Robustness

  • Added #pragma warning disable CA1031 blocks and improved logging in telemetry and tag update methods to ensure that failures in telemetry or tag updates do not affect the primary application logic. Errors are now logged but do not propagate. (TelemetryHelper.cs, TagUpdater.cs) [1] [2] [3] [4] [5] [6]
  • Improved error handling and logging in keyword extraction to handle malformed LLM output gracefully, returning empty results and logging warnings instead of failing document imports. (KernelMemory.cs)

Immutability & Code Quality

  • Updated several fields to readonly and static readonly to improve thread safety and code clarity in ChatHost, KernelMemory, and UserInterface. (ChatHost.cs, KernelMemory.cs, UserInterface.cs) [1] [2] [3]
  • Replaced Path.Combine with Path.Join for file path construction for improved clarity and correctness. (ChatHost.cs, KernelMemory.cs) [1] [2]

Bug Fixes

  • Fixed a bug where a missing file in a document import request would not be properly handled; now returns a BadRequest with logging. (KernelMemory.cs)
  • Corrected logic in document repository to ensure end date filters include the full day. (DocumentRepository.cs)
  • Improved keyword cache refresh logic to avoid redundant keyword additions. (DataCacheManager.cs)
  • Fixed a type check in BusinessTransactionRepository to throw a clear error if an unexpected specification type is passed. (BusinessTransactionRepository.cs)

Frontend Cleanups

  • Removed unused imports and code from chatRoom.tsx for better maintainability and reduced bundle size. (chatRoom.tsx) [1] [2] [3]

Stream Handling Improvements

  • Improved stream reading by using using statements to ensure proper disposal of readers in KernelMemory.cs. [1] [2]

These changes collectively enhance the application's stability, maintainability, and error resilience.

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

Ayaz-Microsoft and others added 8 commits May 13, 2026 17:06
…y and remove unused import in SearchBox and Sidecar components
- Remove unused fileInputRef in searchBox.tsx (UploadMultipleFiles already removed)

- Drop dead selectedDocument state and its setter call in home.tsx

- Drop dead widthClass state and its resize useEffect in home.tsx

- Use locally computed sessionId when constructing new ChatSession; remove unused field

- Log exception in getKeywords catch block instead of swallowing silently

- Use TrackDependency overload that maps wrapper params to telemetry dependencyName/data correctly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- TelemetryHelper: make TrackDependency args fully positional (avoids non-trailing named-arg pitfall)

- KernelMemory: remove unused 'using DnsClient.Internal;'

- KernelMemory.getKeywords: catch JsonException specifically before general fallback

- ChatHost: fix 'occured' -> 'occurred' in user-facing error message

- searchBox: drop dead UploadButton component and its usage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
refactor: improve error handling and logging across multiple components

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 merges development changes into main, focusing on improving resilience of backend telemetry/tagging and keyword-extraction flows, tightening code immutability, and cleaning up/modernizing frontend components.

Changes:

  • Backend: add best-effort exception handling around telemetry and tag updates; harden keyword extraction to tolerate malformed JSON/LLM output.
  • Backend: small logic fix in document date filtering; various readonly/static readonly refactors and minor robustness fixes.
  • Frontend: remove unused imports/state and simplify components to reduce lint noise and improve maintainability.

Reviewed changes

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

Show a summary per file
File Description
Deployment/validate_bicep_params.py Adds clarifying fallback comment for JSON parse failure path in env var scan.
App/frontend-app/src/pages/home/home.tsx Removes unused state and UI resize logic; simplifies chat/document selection handling.
App/frontend-app/src/components/sidecarCopilot/sidecar.tsx Removes unused chat type imports/state values; keeps setters only.
App/frontend-app/src/components/searchResult/old.tsx Removes unused downloadFile import.
App/frontend-app/src/components/searchBox/searchBox.tsx Removes unused upload-button code and unused imports/icons.
App/frontend-app/src/components/documentViewer/documentViewer.tsx Avoids unused state variable for clearChatFlag while keeping setter for downstream usage.
App/frontend-app/src/components/chat/modelSwitch.tsx Removes unused constants/imports.
App/frontend-app/src/components/chat/chatRoom.tsx Removes unused imports/styles and unused temp/sample code; makes temperature immutable.
App/backend-api/Microsoft.GS.DPS/Storage/Documents/DocumentRepository.cs Adjusts end-date filtering to include the end date’s day.
App/backend-api/Microsoft.GS.DPS/Storage/Components/BusinessTransactionRepository.cs Replaces unsafe cast with explicit type-check and clearer exception.
App/backend-api/Microsoft.GS.DPS/Storage/AISearch/TagUpdater.cs Wraps catch-all with CA1031 suppression for best-effort tag updates.
App/backend-api/Microsoft.GS.DPS/API/UserInterface/DataCacheManager.cs Simplifies keyword cache consolidation to avoid redundant additions.
App/backend-api/Microsoft.GS.DPS/API/KernelMemory/KernelMemory.cs Makes dependencies readonly, adds optional logger, improves stream disposal, and hardens keyword JSON parsing.
App/backend-api/Microsoft.GS.DPS/API/ChatHost/ChatHost.cs Makes dependencies readonly, switches to Path.Join, and improves top-level error fallback messaging.
App/backend-api/Microsoft.GS.DPS.Host/Helpers/TelemetryHelper.cs Ensures telemetry failures never break primary flows; updates dependency tracking call signature and adds CA1031 suppressions.
App/backend-api/Microsoft.GS.DPS.Host/API/UserInterface/UserInterface.cs Marks static thumbnails dictionary as readonly (reference immutability).
App/backend-api/Microsoft.GS.DPS.Host/API/KernelMemory/KernelMemory.cs Adds missing-file request handling and removes unused completion flag.
Comments suppressed due to low confidence (1)

App/frontend-app/src/pages/home/home.tsx:446

  • handleChatWithDocument no longer uses its document parameter, which will trigger @typescript-eslint/no-unused-vars warnings unless the unused argument is prefixed with _. Rename the parameter to _document (or remove the parameter and update the prop type if it’s truly unused).
    function handleChatWithDocument(document: Document) {
        setShowCopilot(true);
        if (headerMenuTabsRef.current && showCopilot === false) {
            headerMenuTabsRef.current.scrollIntoView({ behavior: "smooth" });
        }
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fix: chat functionality with error handling
@Roopan-Microsoft
Roopan-Microsoft merged commit a87c024 into main Jun 8, 2026
29 checks passed
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

5 participants