-
Notifications
You must be signed in to change notification settings - Fork 427
Sync main with latest release branch #5299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1ee1f89
RI-7833 Remove icon from cloud database tooltip (#5269)
valkirilov c73e2e6
RI-7754 detect system color change (#5268)
pd-redis 58b6234
RI-7843: remove workbench panel space (#5272)
dantovska ada06b8
RI-7817: clear search button spacing (#5274)
pd-redis bec5f7d
RI-7785 Make Analysis tabs borders and action buttons consitent (#5259)
valkirilov 1302916
RI-7778 Add proper error messages for invalid cloud database endpoint…
valkirilov 34faf52
Bump axios from 1.8.4 to 1.12.0 in /tests/e2e (#5284)
dependabot[bot] 8c65e21
RI-000: bump version to 3.0.0 (#5287)
ArtemHoruzhenko 7e0816c
E2e/feature/ri 7744 fix e2e tests (#5270)
ArtemHoruzhenko d89e35b
RI:7799: Stream bulk delete report (#5278)
pawelangelow 5ec3aa5
RI-7799: Fix download report for electron (#5293)
pawelangelow 3110a8e
fix(ui): remove old color override conflicting with the selected stat…
valkirilov 1e7b922
Merge branch 'main' into latest
valkirilov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,41 @@ | ||
| import { CustomHeaders } from 'uiSrc/constants/api' | ||
|
|
||
| /** | ||
| * Triggers a file download from a URL by creating a temporary link element | ||
| * Triggers a file download from a URL using fetch with proper headers | ||
| * This is necessary for Electron app where window ID authentication is required | ||
| * @param url The full URL to download from | ||
| */ | ||
| export const triggerDownloadFromUrl = (url: string): void => { | ||
| export const triggerDownloadFromUrl = async (url: string): Promise<void> => { | ||
| const headers: Record<string, string> = {} | ||
|
|
||
| // Add window ID header for Electron app authentication | ||
| if (window.windowId) { | ||
| headers[CustomHeaders.WindowId] = window.windowId | ||
| } | ||
|
|
||
| const response = await fetch(url, { headers }) | ||
|
|
||
| if (!response.ok) { | ||
| throw new Error(`Download failed: ${response.statusText}`) | ||
| } | ||
|
|
||
| // Extract filename from Content-Disposition header | ||
| const contentDisposition = response.headers.get('content-disposition') || '' | ||
| const filenameMatch = contentDisposition.match(/filename="?([^";\n]+)"?/) | ||
| const filename = filenameMatch?.[1] || 'download' | ||
|
|
||
| // Convert response to blob and trigger download | ||
| const blob = await response.blob() | ||
| const blobUrl = URL.createObjectURL(blob) | ||
|
|
||
| const link = document.createElement('a') | ||
| link.href = url | ||
| link.href = blobUrl | ||
| link.download = filename | ||
| link.style.display = 'none' | ||
| document.body.appendChild(link) | ||
| link.click() | ||
| document.body.removeChild(link) | ||
|
|
||
| // Clean up the blob URL | ||
| URL.revokeObjectURL(blobUrl) | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Async function call without await loses error handling
The
triggerDownloadFromUrlfunction was changed from synchronous to async (returningPromise<void>), but its caller inBulkActionsConfig.tsxat line 144 does not await the result or handle the promise. When the download fails (e.g., network error or non-ok response), thethrow new Error()at line 19 results in an unhandled promise rejection, silently failing without notifying the user.