Skip to content
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

Merged
merged 12 commits into from
Apr 23, 2024

Conversation

AkshatHotCode
Copy link
Contributor

@AkshatHotCode AkshatHotCode commented Feb 9, 2024

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.

Additional 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

…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.
@CLAassistant
Copy link

CLAassistant commented Feb 9, 2024

CLA assistant check
All committers have signed the CLA.

@cypress-app-bot
Copy link
Collaborator

@jennifer-shehane jennifer-shehane changed the title refactor: ensure 'its' function type excludes null and undefined (#28872) fix: ensure 'its' function type excludes null and undefined (#28872) Feb 9, 2024
Copy link
Member

@jennifer-shehane jennifer-shehane left a 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

@AkshatHotCode AkshatHotCode reopened this Feb 9, 2024
@AkshatHotCode AkshatHotCode marked this pull request as draft February 9, 2024 19:41
@AkshatHotCode AkshatHotCode marked this pull request as ready for review February 10, 2024 05:24
Copy link
Member

@jennifer-shehane jennifer-shehane left a 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

Screenshot 2024-02-27 at 9 59 43 AM

@jennifer-shehane
Copy link
Member

@AkshatHotCode Will you have time to address the lint errors? We'll have to close this PR otherwise.

@AkshatHotCode
Copy link
Contributor Author

I will address this.

@AkshatHotCode
Copy link
Contributor Author

@jennifer-shehane Changes are being made, apologies for the delay.

Co-authored-by: Ryan Manuel <ryanm@cypress.io>
@jennifer-shehane jennifer-shehane changed the title fix: ensure 'its' function type excludes null and undefined (#28872) misc: ensure 'its' function type excludes null and undefined (#28872) Apr 17, 2024
@jennifer-shehane
Copy link
Member

@AkshatHotCode Looking back at this, sorry for the delay

@jennifer-shehane jennifer-shehane merged commit 45cff01 into cypress-io:develop Apr 23, 2024
67 checks passed
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 23, 2024

Released in 13.8.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.8.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Apr 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

its type should exclude null and undefined
5 participants