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

Cypress v12.17.0 crashes when notifications are enabled #27228

Closed
wlsf82 opened this issue Jul 7, 2023 · 6 comments · Fixed by #27237
Closed

Cypress v12.17.0 crashes when notifications are enabled #27228

wlsf82 opened this issue Jul 7, 2023 · 6 comments · Fixed by #27237
Assignees
Labels
CT Issue related to component testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.

Comments

@wlsf82
Copy link

wlsf82 commented Jul 7, 2023

Current behavior

I've just upgraded Cypress to v12.17.0 on a sample project, to test the desktop notifications.

I've enabled all the possible notifications, and pushed the change with the upgrade.

When the run finished, the Cypress App crashed, closed automatically, and left me with the following error in the logs. Also, now, when I open the Cypress App, it automatically crashes with the same error.

o.includes is not a function
TypeError: o.includes is not a function
    at m.sendRunCompletedNotification (<embedded>:4344:95669)
    at m.maybeSendRunNotification (<embedded>:4344:94952)
    at D.x (<embedded>:4225:4181)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async D.checkRelevantRuns (<embedded>:4225:2179)
    at async g.callback (<embedded>:4225:2495)
    at async g.p (<embedded>:4201:16922)
    at async Timeout._onTimeout (<embedded>:4201:17125)
The Test Runner unexpectedly exited via a exit event with signal SIGABRT

Please search Cypress documentation for possible solutions:

https://on.cypress.io

Check if there is a GitHub issue describing this crash:

https://github.com/cypress-io/cypress/issues

Consider opening a new issue.

----------

Platform: darwin-x64 (22.5.0)
Cypress Version: 12.17.0

 *  The terminal process "/bin/zsh '-c', 'npm run cy:open'" terminated with exit code: 1.

Desired behavior

No crash should happen.

Test code to reproduce

https://github.com/wlsf82/testes-e2e-com-cypress-tat-v2

Cypress Version

12.17.0

Node version

v18.15.0

Operating System

macOS Ventura 13.4.1

Debug Logs

No response

Other

No response

@wlsf82
Copy link
Author

wlsf82 commented Jul 7, 2023

Cc @emilyrohrbough.

@warrensplayer
Copy link
Contributor

@wlsf82 Can you share your state.json file under ~/Library/Application Support/Cypress/cy/production/projects/__global__? That is where those notification preferences are stored.

Also, can you run Cypress and set the debug environment variable to DEBUG=cypress:data-context:NotificationActions and share those logs?

Finally, you can also edit that file and change desktopNotificationsEnabled to false to disable the notifications and you should be able to open the Cypress app again without error while we look into this issue.

@warrensplayer
Copy link
Contributor

@wlsf82 I was able to reproduce this error. When enabling the notifications for the first time, it is possible that the notifyWhenRunCompletes value in the state.json file gets set as a boolean value when checked instead of an array of values that the code expects. Please share your state.json file that a mention above to confirm that is what is happening to you.

Temporary workaround
If you change the notifyWhenRunCompletes value from a boolean to an empty array ([]), then you should be able open Cypress, go back to your settings page, and enable the individual statuses that you want for notifications.

I am working on a fix to correct this going forward and update any bad state.json entires as well.

@warrensplayer warrensplayer added CT Issue related to component testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. labels Jul 7, 2023
@wlsf82
Copy link
Author

wlsf82 commented Jul 7, 2023

Hi @warrensplayer, this is what my state.json looks like;

{
  "showedStudioModal": true,
  "preferredOpener": {
    "id": "code",
    "name": "Visual Studio Code",
    "openerId": "code",
    "isOther": false
  },
  "firstOpenedCypress": 1624573527459,
  "preferredEditorBinary": "code",
  "isSpecsListOpen": false,
  "autoScrollingEnabled": true,
  "browserX": 15,
  "browserY": 27,
  "isBrowserDevToolsOpen": false,
  "browserWidth": 1479,
  "browserHeight": 974,
  "majorVersionWelcomeDismissed": {
    "11": 1668085987610,
    "12": 1670352724766
  },
  "reporterWidth": 375,
  "appX": 15,
  "appY": 32,
  "desktopNotificationsEnabled": true,
  "notifyWhenRunStarts": true,
  "notifyWhenRunCompletes": true
}

For now, I've changed desktopNotificationsEnabled to false and notifyWhenRunCompletes to [].

I'm looking forward to the patch release.

@wlsf82
Copy link
Author

wlsf82 commented Jul 7, 2023

By the way, by changing desktopNotificationsEnabled to true and correctly configuring notifyWhenRunCompletes as an array, the notifications work great!

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 10, 2023

Released in 12.17.1.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CT Issue related to component testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants