Closed jpwilliams closed 12 months ago
Latest commit: 4b10014d029054503dbe83e2e5486b86259dd74b
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/inngest/inngest-js/new/fix-fromrecord-name-clash?filename=.changeset/lemon-plums-care.md&value=---%0A%22inngest%22%3A%20patch%0A---%0A%0AEnsure%20%60fromRecord%3C%3E()%60%20doesn't%20accept%20clashing%20names%0A)
Summary
new EventSchemas().fromRecord()
can silently fail and drop all type inference if the user has given aname
inside an event as well as a key and the two are not the same.In this case, it's hard to know what the user is intending to do and which name they'd prefer, so instead we show an error stating that they should probably omit
name
.Previously, this would not fail, but drop all type inference.
Instead, this will throw a hacky TS error stating you should probably omit
name
.A tad hacky, but better than type inference silently turning off.
Checklist
Added a docs PR that references this PRN/A Bug fix