fix(core): cannot download comment files (#13136)

#### PR Dependency Tree


* **PR #13136** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added a timeout of 3 minutes to comment attachment uploads, improving
reliability for long uploads.

* **Refactor**
* Unified the file download process to always use blob conversion,
ensuring consistent behavior for all URLs.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Peng Xiao
2025-07-10 15:48:17 +08:00
committed by GitHub
parent ad5a122391
commit 7d527c7f3a
2 changed files with 1 additions and 7 deletions

View File

@@ -337,6 +337,7 @@ export class DocCommentStore extends Entity<{
}
const res = await graphql.gql({
timeout: 180_000,
query: uploadCommentAttachmentMutation,
variables: {
workspaceId: this.currentWorkspaceId,

View File

@@ -42,13 +42,6 @@ export function downloadFile(url: string, filename: string) {
}
export async function downloadResourceWithUrl(url: string, filename: string) {
// 1. if url is not same origin, fetch it to blob and download it
// 2. otherwise, download it directly
const sameOrigin = new URL(url).origin === window.location.origin;
if (sameOrigin) {
downloadFile(url, filename);
return;
}
// given input url may not have correct mime type
const blob = await resourceUrlToBlob(url);
if (!blob) return;