[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 wants to merge 5 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)
📝 WalkthroughWalkthroughAdds a "Download troubleshooting data" action to the Admin UI privacy request workflow: new hook to fetch diagnostics and perform downloads, dropdown integration to surface the action, new API lazy endpoint to retrieve diagnostics, and a response type for the diagnostics export. Changes
Sequence DiagramsequenceDiagram
participant Admin as Admin User
participant Dropdown as PrivacyRequestActionsDropdown
participant Hook as useDownloadPrivacyRequestDiagnostics
participant API as Privacy Request API
participant Storage as Remote Storage
Admin->>Dropdown: Click "Download troubleshooting data"
Dropdown->>Hook: call downloadTroubleshootingData()
Hook->>API: GET /privacy-request/{id}/diagnostics
API->>Storage: generate/upload diagnostics (if needed)
Storage-->>API: return download_url
API-->>Hook: return PrivacyRequestDiagnosticsExportResponse
Hook->>Hook: validate download_url & storage_type
Hook->>Storage: fetch diagnostics file (remote URL)
Storage-->>Hook: return file stream/url
Hook->>Admin: trigger browser download (anchor click)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 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.
| storage_type: string; | ||
| object_key: string; | ||
| created_at: string; | ||
| } |
There was a problem hiding this comment.
Can we use an auto-generated type for this?
| menu.push({ | ||
| key: "download-troubleshooting-data", | ||
| label: ( | ||
| <span data-testid="download-troubleshooting-data-btn"> |
There was a problem hiding this comment.
This doesn't seem to be used in any tests, so we shouldn't need the span wrapper with the test ID.
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