feat(web): add lightweight workspace matching existing UI
This commit is contained in:
@@ -47,6 +47,18 @@ test('downloads bound concurrent bytes, validate hashes/types, cancel queued wor
|
||||
await assert.rejects(wrongType.download({...file,kind:'image',mimeType:'image/png'}),/type did not match/);
|
||||
});
|
||||
|
||||
test('downloads support older AbortSignals without throwIfAborted or reason', async () => {
|
||||
let calls = 0;
|
||||
const client = new AgentRoomClient({ fetch: async () => { calls++; return new Response('data'); } });
|
||||
const controller = new AbortController();
|
||||
Object.defineProperty(controller.signal, 'throwIfAborted', { value: undefined });
|
||||
Object.defineProperty(controller.signal, 'reason', { value: undefined });
|
||||
assert.equal(await (await client.download(file, controller.signal)).text(), 'data');
|
||||
controller.abort();
|
||||
await assert.rejects(client.download(file, controller.signal), error => error.name === 'AbortError');
|
||||
assert.equal(calls, 1, 'an already canceled download never starts another request');
|
||||
});
|
||||
|
||||
test('composer gates unsupported servers, count/type/size and batches before upload; preserves retry ID and remove races',async()=>{
|
||||
let capability, attempts=[], next=0, changed=0, finish;
|
||||
const queue=createAgentUploadQueue({capability:()=>capability,newId:()=>`upload-${++next}`,changed:()=>changed++,upload:async(_file,id,signal)=>{attempts.push({id,signal});if(attempts.length===1)throw new Error('Quota full');return new Promise(resolve=>finish=resolve);}});
|
||||
|
||||
Reference in New Issue
Block a user