knex: Missing event listener in Transaction

Environment

Knex version: 0.21.6 - 27 September, 2020 Database + version: PG 12 OS: MacOS Catalina

The on('start', ...) listener is missing in the makeTxClient function in file lib/transaction.js.

See attachment.

Skärmavbild 2020-10-27 kl  10 00 29

Should add:

  trxClient.on('start', function (arg) {
    trx.emit('start', arg);
    client.emit('start', arg);
  });

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (4 by maintainers)

Most upvoted comments

@danieljwestman was busy with other fixes yesterday, will focus on this one today. thank you for the ping

Thank you! Will give it a shot tonight.

Yes, thats correct. All queries are triggering the “start” event for “root” but none for “children” instances (transactions). The other events (like “query”) are always triggered, since they are included in the transaction make funktion (as explained above).