-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
misc: ensure 'its' function type excludes null and undefined (#28872) #28904
misc: ensure 'its' function type excludes null and undefined (#28872) #28904
Conversation
…ress-io#28872) This fix addresses an issue where the 'its' function could return null or undefined, causing unexpected behavior in certain scenarios. The change introduces a more robust type check to ensure that the returned value is always non-null and non-undefined.
|
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.
@AkshatHotCode There are some errors in the lint types and unit tests. Could you look at those from the failing CircleCI checks above? We'll also need a changelog entry for this change. https://github.com/cypress-io/cypress/blob/develop/guides/writing-the-cypress-changelog.md
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.
@AkshatHotCode Looks like there's some Lint errors - likely from the formatting changes you made that were unrelated to the actual fix. https://app.circleci.com/pipelines/github/cypress-io/cypress/60042/workflows/b5c2b3d3-bbae-40df-92db-f7058dd2a131/jobs/2498299
@AkshatHotCode Will you have time to address the lint errors? We'll have to close this PR otherwise. |
I will address this. |
@jennifer-shehane Changes are being made, apologies for the delay. |
Co-authored-by: Ryan Manuel <[email protected]>
@AkshatHotCode Looking back at this, sorry for the delay |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
This fix addresses an issue where the 'its' function could return null or undefined, causing unexpected behavior in certain scenarios. The change introduces a more robust type check to ensure that the returned value is always non-null and non-undefined.
its
type should excludenull
andundefined
#28872Additional details
The change was necessary to address an issue where the 'its' function could potentially return null or undefined. This behavior led to unexpected outcomes in certain scenarios. The fix ensures that the 'its' function consistently returns a value that is non-null and non-undefined.
The affected area is the 'its' function, specifically its type signature. Prior to the fix, the function had the potential to return null or undefined. This change impacts any usage of the 'its' function, ensuring that users can rely on a non-null and non-undefined result.
The implementation involves a modification to the 'its' function to include a more robust type check. This check ensures that the returned value is guaranteed to be non-null and non-undefined.
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?