timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.15k stars 160 forks source link

Semver issue, breaking change between version 9.0.0 and 9.0.1 #396

Closed mikecann closed 3 months ago

mikecann commented 1 year ago

Unfortunately, I just upgraded from version 9.0.0 to 9.0.1 and noticed that my code no longer compiles.

This is unexpected as this is only a minor change.

The issue centres around this change: https://github.com/timgit/pg-boss/compare/9.0.0...9.0.1#diff-a150fb53afee945f23f3fe7c176007111f3ba81bb0d188af4077d4a0fc4caa37L127

For example this code used to compile:

await this.services.pgBoss.client.work<GeneralJob>(
      queueName,
      async (job) => {
        return await handler(job.data);
      }
    );

Now it no longer does and instead requires that you don't return anything:

await this.services.pgBoss.client.work<GeneralJob>(queueName, async (job) => {
      await handler(job.data);
    });

Its not a big issue but I thought you should be aware that this might cause others' projects to unexpectadly to no longer compile.

felipeelias commented 1 year ago

Seems related to #393

timgit commented 1 year ago

Please try this again in 9.0.2 and see if it's resolved