Skip to content

fix: Fixed Citation URL load issue - #2393

Merged
Roopan-Microsoft merged 6 commits into
Azure-Samples:devfrom
Prajwal-Microsoft:main
Oct 7, 2026
Merged

Roopan-Microsoft merged 6 commits into
Azure-Samples:devfrom
Prajwal-Microsoft:main

Conversation

@Prajwal-Microsoft

@Prajwal-Microsoft Prajwal-Microsoft commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

  • This pull request enhances the way the frontend handles "Open document" links for citations, especially for files stored behind backend authentication (Easy Auth). It introduces a new API client for securely fetching these files, updates the UI to distinguish between external and backend-gated documents, and adds comprehensive tests for the new logic.

Backend-gated file handling improvements:

  • Added a new REST client fetchDocumentObjectUrl in src/frontend/src/api/files.tsx to fetch document blobs from /api/files/<name> using authenticated requests and return object URLs for inline viewing.
  • Updated the CitationDetailPanel component to open backend-gated files by fetching them with the bearer token and redirecting a placeholder tab to the resulting object URL, ensuring files behind Easy Auth are accessible in the UI. [1] [2]
  • Created a new CitationDocument type and resolveCitationDocument function in documentHref.tsx to classify citation targets as either external URLs or backend-gated files, improving link handling logic. [1] [2]

Testing and coverage:

  • Added a dedicated test suite for fetchDocumentObjectUrl covering authentication headers, object URL creation, and error handling.
  • Extended tests for CitationDetailPanel to verify correct behavior when opening backend-gated files versus external links, including mocking and asserting fetch logic. [1] [2]
  • Added tests for resolveCitationDocument to ensure correct classification of citation targets. [1] [2]

Build and config updates:

  • Updated the TypeScript build info to include the new files.tsx API module.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

@Roopan-Microsoft
Roopan-Microsoft merged commit 9cc45c1 into Azure-Samples:dev Oct 7, 2026
9 of 10 checks passed

This branch had an error being deployed

1 failed deployment
production — 3c47da1c Deployed Oct 7, 2026 by Prajwal-Microsoft via azd template validation #107
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