test: enforce async extension API contract (#1452)

This commit is contained in:
Levi authored and GitHub committed 2026-08-27 12:51:37 +08:00
1 parent cfdf87c3b8
commit 59f3aa7028
13 files changed
+121 -77

No files matched your search

+4 -4
View File
@@ -4,7 +4,7 @@ gopeed.events.onResolve(async function (ctx) {
return;
}
const url = gopeed.runtime.blob.createObjectURL(async ({ offset = 0 }) => new ReadableStream({
const url = await gopeed.runtime.blob.createObjectURL(async ({ offset = 0 }) => new ReadableStream({
async start(controller) {
if (offset > 0) {
controller.close();
@@ -40,7 +40,7 @@ gopeed.events.onError(async function (ctx) {
return;
}
req.putLabel("recovered", "true");
ctx.task.setUrl(gopeed.runtime.blob.createObjectURL(new Blob(["ok\n"], { type: "text/plain" })));
ctx.task.continue();
await req.putLabel("recovered", "true");
await ctx.task.setUrl(await gopeed.runtime.blob.createObjectURL(new Blob(["ok\n"], { type: "text/plain" })));
await ctx.task.continue();
});