sql-js / sql-js/sql.js

Cannot reference postMessage id on error in web workers

Open
#231 0 comments 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.