diff --git a/src/services/upload-strategy.ts b/src/services/upload-strategy.ts index 80864bf..fcae5ee 100644 --- a/src/services/upload-strategy.ts +++ b/src/services/upload-strategy.ts @@ -4,7 +4,7 @@ import { waitForUploadCompletion, isTransientCompletionError } from './upload-co import type { ApiResponse, ChunkUploadInitResponse, FileUploadResponse, UploadProgress } from '@/types' import { calculateFileHash } from '@/utils/file-processing' -export const CHUNK_SIZE = 100 * 1024 * 1024 +export const CHUNK_SIZE = 90 * 1024 * 1024 type ChunkedUploadOptions = { cancellation?: UploadCancellation diff --git a/tests/transferUi.integration.test.mjs b/tests/transferUi.integration.test.mjs index df19646..ba9026f 100644 --- a/tests/transferUi.integration.test.mjs +++ b/tests/transferUi.integration.test.mjs @@ -10,7 +10,7 @@ before(async()=>{originalWindow=globalThis.window;globalThis.window={location:{o after(async()=>{await server?.close();globalThis.window=originalWindow}) async function render(component,props){const context={};const app=createSSRApp({render:()=>h(component,props)});app.use(createI18n({legacy:false,locale:'zh-CN',messages:{'zh-CN':zh}}));return (await renderToString(app,context))+Object.values(context.teleports||{}).join('')} test('upload area displays actual bytes while sending and verifying',async()=>{ - for(const uploadStatus of ['uploading','confirming']){const html=await render(Area,{uploadStatus,uploadedBytes:52428800,totalBytes:104857600,progress:50});assert.ok(html.includes('50 MB / 100 MB'));assert.ok(!html.includes('0 B / 0 B'))} + for(const uploadStatus of ['uploading','confirming']){const html=await render(Area,{uploadStatus,uploadedBytes:52428800,totalBytes:94371840,progress:50});assert.ok(html.includes('50 MB / 90 MB'));assert.ok(!html.includes('0 B / 0 B'))} }) test('retrieval detail uses accessible shared dialog and exposes entire long filename',async()=>{ const filename='FlClash-'+'long-'.repeat(25)+'android-arm64-v8a.apk';const html=await render(Detail,{visible:true,record:{filename,size:'51.58 MB',date:'2026/09/18 15:08:09',code:'ABCD2345',downloadUrl:'/share/download?code=ABCD2345'}})