-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shield fails requests for parameter objects that have more properties then definition #78
Comments
I'd argue it's a good thing: your code is doing something unexpected and should be fixed. (I actually wonder why TypeScript doesn't complain about this.) So I'd say: it's not a bug but a feature. But feel free to let me know if you find situations when it's actually annoying. E.g. if the error message is confusing, then that should be fixed. Closing in the meantime. |
Ah sorry for not being clear enough: It is not the build process that is failing but the (deployed) production build at runtime. |
I agree. PR welcome to fail earlier. It may be tricky to implement though. |
As mentioned in #57 this is a massive footgun. Yesterday I had the fourth bug in production because of this behaviour. Can we reopen this issue? It is really not solved. I think a good solution would be to have a config option that makes shields not fail on objects with obsolete fields. |
I'm still thinking it would be better to fail earlier instead of being permissive. Because, if you want to be permissive, then you can/should use a more permissive type such as Feel free to disagree and/or create a new feature request for it. |
calling this telefunction
with an additional property in the object will fail the request with 403
Not sure if I'm considering this a bug or not. It is definitely unexpected and dangerous behaviour which can cause your production build to fail unexpectedly because as far as typescript is concerned the types match and it will not give you a type error or warning if you write
myTelefunc({ foo: "o", bar: "b"})
The text was updated successfully, but these errors were encountered: