- Notifications
You must be signed in to change notification settings - Fork925
fix: updateDeleteWorkspaceOptions
to pick properties correctly#13423
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This PR is a hotfix and has been automatically approved.
- ✅ Base is main
- ✅ Has hotfix label
- ✅ Head is from coder/coder
- ✅ Less than 100 lines
matifali commentedMay 31, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@Parkreiner could it be related to#13257. |
Parkreiner commentedMay 31, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@matifali I haven't had the chance to touch the backend part of Coder core yet (I still need to learn Go), so I'm not 100% sure. My gut feeling, though, is that it wouldn't affect things too much The client-side function takes the ID of a workspace, and an optional options object. This PR only affects that options object, and while incorrect properties were getting added to it, I would expect the server to just filter those out. The object has no required properties |
19530c6
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Found this while writing the docs for the Backstage Coder SDK:
It's literally a single character difference, but the second
Pick
argument should be:Changes made
&
to a|
Explanation
With the
&
, you have an intersection instead of a union. Basically, that says "give me a type that is both the literal"log_level"
and the literal"orphan"
at the same time". It's impossible for a value to be two different things at the exact same time, so the resulting type isnever
. When you picknever
from an object, you pick nothing, so the ultimate resulting type is the type{}
(which is equivalent toNonullable<unknown>
).Nonullable<unknown>
isn't much better than anany
type – it's basicallyany
, but withnull
andundefined
removed