Skip to content

Conversation

@dawidreedsy
Copy link

At the moment when we pass payload like this:

{someProp: undefined}

It stores it mongoDb Db, but it auto convert it to null value, however it might be error prone as we may enqueue job that has callbackUrl: undefined, then the mongo queue saves in db, which converts it to callbackUrl: null, then when getting the message from queue worker validate the job payload and has type t.partial({callbackUrl: t.string}}). The validation will fail.

At the moment when we pass payload like this:
```ts
{someProp: undefined}
```

It stores it mongoDb Db, but it auto convert it to null value, however
it might be error prone as we may enqueue job that has `callbackUrl: undefined`, then the mongo queue saves in db, which converts it to `callbackUrl: null`, then when getting the message from queue worker validate the job payload and has type `t.partial({callbackUrl: t.string}})`. The validation will fail.
@dawidreedsy dawidreedsy force-pushed the remove-undefined-prop branch from 43bcd00 to 772580d Compare January 2, 2024 10:28
@dawidreedsy dawidreedsy requested a review from alecgibson January 2, 2024 10:29
@dawidreedsy dawidreedsy merged commit bf640e1 into main Jan 2, 2024
@dawidreedsy dawidreedsy deleted the remove-undefined-prop branch January 2, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants