mcollina / mqtt-level-store

Store your in-flight MQTT message on Level, for Node
MIT License
24 stars 11 forks source link

end event fires prematurely #21

Open Climax777 opened 3 years ago

Climax777 commented 3 years ago

I inititally thought the problem is in MQTT itself

Though after thorough testing, I found that level-sublevel's readStream sends 'end' event prematurely. It sends it after the last item is read, rather than the last read(1) === null. This causes a bunch of problems (see below) https://github.com/mqttjs/MQTT.js/issues/1319

robertsLando commented 1 year ago

I have created a new store that could help: https://github.com/robertsLando/mqtt-jsonl-store