Cannot reference postMessage id on error in web workers
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Perhaps I am just missing it, but there doesn't seem to be a way to trace an error back to the message posted in web workers. For example, if:
this.webWorkerCatalogSQLiteDB.postMessage({
id: id,
action: 'exec',
sql: queryStr
});
Results in an error, this gets handled in
this.webWorkerCatalogSQLiteDB.onerror = (error)=> { //TODO };
However, the error object returned doesn't seem to have any reference to the id of the message posted, unlike the success message, which has an event.data.id that references back.
Any advice?
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.
Research direction
Start with the web worker postMessage call and the onerror handler shown in the issue, then inspect how success events expose event.data.id. Determine whether the worker error path can retain or expose the posted message id; done would be a documented or implemented way to correlate errors with messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- databases, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100