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

Remove .then wrap from return value of Cypress.Blob.base64StringToBlob #8365

Closed
chrisbreiding opened this issue Aug 20, 2020 · 2 comments · Fixed by #8366
Closed

Remove .then wrap from return value of Cypress.Blob.base64StringToBlob #8365

chrisbreiding opened this issue Aug 20, 2020 · 2 comments · Fixed by #8366
Assignees
Labels
pkg/driver This is due to an issue in the packages/driver directory type: bug

Comments

@chrisbreiding
Copy link
Contributor

chrisbreiding commented Aug 20, 2020

Current behavior:

We added a .then method to the return value of Cypress.Blob.base64StringToBlob so we could improve the error message when a user attempts to use its old promise-returning API (see this comment). This causes methods like Promise.resolve and Promise.try to think the return value is a thenable, invoking the .then and throwing our error. This makes it difficult to add backwards compatibility without an ugly hack.

Desired behavior:

We shouldn't add on the .then method so that the return value is not mistaken for a promise-returning value. This may just result in a .then is not a function error when using the old API, but that might not be so bad.

Test code to reproduce

it('uses Cypress.Blob.base64StringToBlob', () => {
  return Cypress.Promise.resolve(Cypress.Blob.base64StringToBlob(btoa('foo')))
})

Versions

Cypress 5.0.0

@chrisbreiding chrisbreiding self-assigned this Aug 20, 2020
@chrisbreiding chrisbreiding added internal-priority type: bug pkg/driver This is due to an issue in the packages/driver directory labels Aug 20, 2020
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: work in progress and removed stage: needs review The PR code is done & tested, needs review labels Aug 20, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 20, 2020

The code for this is done in cypress-io/cypress#8366, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 1, 2020

Released in 5.1.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg/driver This is due to an issue in the packages/driver directory type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant