Level / levelup

A wrapper for abstract-leveldown compliant stores, for Node.js and browsers.
MIT License
4.09k stars 265 forks source link

incorrect promises implementation #741

Closed dcharbonnier closed 2 years ago

dcharbonnier commented 2 years ago

await db.open() will never reject and an error event will be emitter crashing the process.

a dirty workaround that should not add issue the day this is fixed:

await new Promise<void>((resolve, reject) => {
        db.once("error", (err) => reject(err));
        db.open((err) => {
          if (err) {
            reject(err);
          } else {
            resolve();
          }
        });
      });
vweevers commented 2 years ago

Duplicate of https://github.com/Level/levelup/issues/710

dcharbonnier commented 2 years ago

710 is closed, is this fix not released ?