Support using AbortController with FileAPI
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- html, javascript
- Domain
- api
Research direction
Start with the FileReader and AbortController examples in the issue, then read the FileAPI specification entry points for FileReader construction, reading, aborting, and error handling. Define the signal-support behavior and its interaction with existing reader events; done means the specification consistently describes cancellation and its observable results.
Written by the indexing model from the issue text.
Description
Hey,
It would be useful to use the web platform standard cancellation method to abort readers.
Other web platform code (like fetch) supports cancellation through signals.
Code before:
async function readFile(file, { signal }) {
var reader = new FileReader();
const handler = e => reader.abort();
signal.addEventListener('abort', handler, { once: true });
reader.addEventListener('load', () => signal.removeEventListener('abort', handler));
reader.addEventListener('error', () => signal.removeEventListener('abort', handler));
const p = new Promise((resolve, reject) => {
reader.onload = (e) => resolve(e.target.result);
reader.onerror = (e) => reject(reader.error);
});
reader.readAsText(file);
return await p;
}
Possible suggested change, assuming signal support:
async function readFile(file, { signal }) {
var reader = new FileReader({ signal });
const p = new Promise((resolve, reject) => {
reader.onload = (e) => resolve(e.target.result);
reader.onerror = (e) => reject(reader.error);
});
reader.readAsText(file);
return await p;
}
- Dominant language
- HTML
- Stars
- 118
- Forks
- 52
- Avg merge
- 9d 16h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from w3c/FileAPI
-
TPAC2026
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Similar issues
-
area/sessions comp/cron comp/gateway P2 sweeper:risk-message-delivery sweeper:risk-session-state type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#118863 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3312 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
needs-acceptance wg/data-plane-networking
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#4024 · 1 comment ·