[ENG-2735] Add "download troubleshooting data" action to privacy request admin UI#7548
[ENG-2735] Add "download troubleshooting data" action to privacy request admin UI#7548nreyes-dev merged 7 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
(delete empty trailing line)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a "Download troubleshooting data" action to the privacy request Admin UI: new API endpoint for diagnostics, a lazy query hook with permission checks and download logic, new response types, and a conditional dropdown menu item that triggers the download flow. Changes
Sequence DiagramsequenceDiagram
actor User
participant UI as PrivacyRequestActionsDropdown
participant Hook as useDownloadPrivacyRequestDiagnostics
participant API as privacyRequestApi
participant Browser as Browser/Download
User->>UI: Click "Download troubleshooting data"
UI->>Hook: downloadTroubleshootingData()
Hook->>API: useLazyGetPrivacyRequestDiagnosticsQuery -> GET /privacy-request/{id}/diagnostics
API-->>Hook: PrivacyRequestDiagnosticsExportResponse
Hook->>Hook: extract download_url & check storage_type
alt Remote URL
Hook->>Browser: create anchor & trigger download
Browser-->>User: file downloaded
else Local storage
Hook-->>User: show info (data stored locally)
end
Hook-->>UI: update isLoading
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR adds a "Download troubleshooting data" action to the privacy request admin UI. It introduces a new RTK Query endpoint ( The overall approach is well-structured and consistent with the existing
Confidence Score: 2/5
Last reviewed commit: 315a8cb |
clients/admin-ui/src/features/privacy-requests/hooks/useDownloadPrivacyRequestDiagnostics.ts
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/privacy-requests/hooks/useDownloadPrivacyRequestDiagnostics.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@clients/admin-ui/src/features/privacy-requests/hooks/useDownloadPrivacyRequestDiagnostics.ts`:
- Around line 27-30: The code is passing preferCacheValue=true to
fetchDiagnostics which may return stale presigned download_url; update the call
in useDownloadPrivacyRequestDiagnostics (the fetchDiagnostics trigger) to omit
the second boolean argument so it always fetches fresh data: replace
fetchDiagnostics({ privacy_request_id: privacyRequest.id }, true) with a
single-argument call fetchDiagnostics({ privacy_request_id: privacyRequest.id })
(or otherwise remove/disable the preferCacheValue flag) so presigned URLs are
not served from cache.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bea76d71-61be-4a68-a00c-6c87fee13ccf
📒 Files selected for processing (5)
changelog/ENG-2735-download-troubleshooting-data.yamlclients/admin-ui/src/features/privacy-requests/PrivacyRequestActionsDropdown.tsxclients/admin-ui/src/features/privacy-requests/hooks/useDownloadPrivacyRequestDiagnostics.tsclients/admin-ui/src/features/privacy-requests/privacy-requests.slice.tsclients/admin-ui/src/features/privacy-requests/types.ts
clients/admin-ui/src/features/privacy-requests/hooks/useDownloadPrivacyRequestDiagnostics.ts
Outdated
Show resolved
Hide resolved
jpople
left a comment
There was a problem hiding this comment.
Looks good overall, couple nits about the code.
clients/admin-ui/src/features/privacy-requests/PrivacyRequestActionsDropdown.tsx
Outdated
Show resolved
Hide resolved
as long as there are no tests for it, it's not needed
Ticket ENG-2735
Description Of Changes
Add "download troubleshooting data" action to privacy request admin UI

Code Changes
getPrivacyRequestDiagnosticsinfides/clients/admin-ui/src/features/privacy-requests/privacy-requests.slice.ts(GETprivacy-request/${privacy_request_id}/diagnostics) and exportuseLazyGetPrivacyRequestDiagnosticsQuery.useDownloadPrivacyRequestDiagnosticsinfides/clients/admin-ui/src/features/privacy-requests/hooks/useDownloadPrivacyRequestDiagnostics.tsto:download_urlviauseLazyGetPrivacyRequestDiagnosticsQueryScopeRegistryEnum.PRIVACY_REQUEST_READfides/clients/admin-ui/src/features/privacy-requests/PrivacyRequestActionsDropdown.tsxto add a “Download troubleshooting data” action (disabled while the request is fetching) withdata-testid="download-troubleshooting-data-btn. This dropdown is rendered on the privacy request details page (fides/clients/admin-ui/src/pages/privacy-requests/[id].tsx).Steps to Confirm
download_url).PRIVACY_REQUEST_READ.Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and worksSummary by CodeRabbit