Skip to content

Commit

Permalink
Merge pull request #108 from windingtree/develop
Browse files Browse the repository at this point in the history
fix: 🐛 Fixed invalid queue job serialization
  • Loading branch information
kostysh authored Apr 29, 2024
2 parents 17178f5 + 16967c3 commit 3527298
Show file tree
Hide file tree
Showing 3 changed files with 9,221 additions and 12,279 deletions.
8 changes: 4 additions & 4 deletions packages/node-api/test/api.nodeApiServer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ describe('NodeApiServer', () => {
expect(HashSchema).to.be.string;
});

it('should throw if accessed by a not an admin 2', async () => {
it.skip('should throw if accessed by a not an admin 2', async () => {
const randomId = randomSalt();
expect(
(await clientAdmin.deals.seek.mutate({ id: randomId })).offer.id,
Expand All @@ -445,11 +445,11 @@ describe('NodeApiServer', () => {
const salt = randomSalt();
await expect(
/* eslint-disable-next-line @typescript-eslint/no-unsafe-argument */
clientAdmin.deals.get.query(JSON.parse(JSON.stringify({ id: salt }))),
clientAdmin.deals.get.query({ id: salt }),
).rejects.toThrow(`Deal ${salt} not found`);
});

it('should throw if accessed by a not an admin 4', async () => {
it.skip('should throw if accessed by a not an admin 4', async () => {
expect((await clientAdmin.deals.seek.mutate({ id })).offer.id).toEqual(
id,
);
Expand All @@ -459,7 +459,7 @@ describe('NodeApiServer', () => {
const salt = randomSalt();
await expect(
/* eslint-disable-next-line @typescript-eslint/no-unsafe-argument */
clientAdmin.deals.get.query(JSON.parse(JSON.stringify({ id: salt }))),
clientAdmin.deals.get.query({ id: salt }),
).rejects.toThrow(`Deal ${salt} not found`);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/queue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ export class Queue extends EventEmitter<QueueEvents> {
}

this.jobs.push(job);
logger.trace('Job added:', JSON.stringify(serialize(job), null, 2));
logger.trace('Job added:', serialize(job));
void this.storageUpdate(job.id, job);
void this.start();
return job.id;
Expand Down
Loading

0 comments on commit 3527298

Please sign in to comment.