You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
? // JsonifyObject recursive call for its children
JsonifyObject<UndefinedToOptional<T>>// An object with known keys can be processed directly
: Simplify<
JsonifyObject<UndefinedToOptional<T>>&
// If the object has generic keys, this is a
// mapped type and we need to process the
// generic and known keys separately
JsonifyObject<
UndefinedToOptional<Pick<T,KnownKeys<T>>>
>
>
Solution
Some TypeScript packages that perform some similar functionality are very opinionated about required configuration options. For example, type-fest: sindresorhus/type-fest#668 (comment)
However, as we wish to fit as quietly into a user's existing codebase as possible, ideally we:
Add unit tests with a project using this option, which may surface other small issues
If we can, account for strictNullChecks: false in this UndefinedToOptional type
The text was updated successfully, but these errors were encountered:
Summary
Step returns use the
Jsonify
type to represent the result of a step being (de)serialized as it is passed to and from Inngest.If
strictNullChecks: false
is set in a user'stsconfig.json
, however, this type sets some properties to optional that shouldn't be optional.Example
Here's a playground example with
strictNullChecks: false
set. Notice howfoo
is optional where it shouldn't be. https://tsplay.dev/WyVMKwCause
This issue was introduced in #512 and released in 3.15.5. Specifically, this piece here:
inngest-js/packages/inngest/src/helpers/jsonify.ts
Lines 306 to 317 in 56c7ee2
Solution
Some TypeScript packages that perform some similar functionality are very opinionated about required configuration options. For example,
type-fest
: sindresorhus/type-fest#668 (comment)However, as we wish to fit as quietly into a user's existing codebase as possible, ideally we:
strictNullChecks: false
in thisUndefinedToOptional
typeThe text was updated successfully, but these errors were encountered: