cypress icon indicating copy to clipboard operation
cypress copied to clipboard

fix: ensure 'its' function type excludes null and undefined (#28872)

Open AkshatHotCode opened this issue 1 year ago • 2 comments

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.

  • Closes https://github.com/cypress-io/cypress/issues/28872

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

AkshatHotCode avatar Feb 09 '24 08:02 AkshatHotCode

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 09 '24 08:02 CLAassistant

cypress-app-bot avatar Feb 09 '24 08:02 cypress-app-bot

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

jennifer-shehane avatar Mar 07 '24 14:03 jennifer-shehane

I will address this.

AkshatHotCode avatar Mar 08 '24 05:03 AkshatHotCode

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

AkshatHotCode avatar Mar 08 '24 06:03 AkshatHotCode

@AkshatHotCode Looking back at this, sorry for the delay

jennifer-shehane avatar Apr 17 '24 14:04 jennifer-shehane

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[bot] avatar Apr 23 '24 21:04 cypress-bot[bot]