-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix: correct invalid stored preference for in-app notifications #27237
fix: correct invalid stored preference for in-app notifications #27237
Conversation
7 flaky tests on run #48654 ↗︎
Details:
commands/net_stubbing.cy.ts • 2 flaky tests • 5x-driver-chrome:beta
e2e/origin/commands/navigation.cy.ts • 1 flaky test • 5x-driver-chrome:beta
e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-chrome:beta
cypress/cypress.cy.js • 3 flaky tests • 5x-driver-chrome:beta
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
So far this seems to be working well when testing 👍 - going to try some more scenarios. Noticed we link to https://docs.cypress.io/guides/cloud/cypress-app-integration#Troubleshooting for troubleshooting, but that URL is 404, if we need to change anything for that we should do it in this PR. |
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.
No test 😢 ?
const listRef = ref() | ||
|
||
// allow for gql value to load when navigating straight here from EnableNotificationsBanner | ||
watchEffect(() => { |
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.
IIRC there's a vueuse/core
function that effectively does this a bit more succinctly, but this gets the job done so I'm fine with it
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.
PR looks good to me. Ideally the NotifyWhenRunCompletes
would never be a type boolean
in the first place but this PR certainly accounts for the scenario in which it is.
It looks like a PR has already been merged for the on-link that was 404, just hasn't been deployed yet, so no action needed in this branch to get it working. |
Added dcc13c0 |
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.
Looks good, glad to have the test, it successfully repaired the state for me.
Do you have a date for the fix release? |
First thing next week (July 10) Sorry, thanks for the interest @wlsf82 🎉 |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
When navigating to the settings page after enabling in-app notifications with the top banner, the value for the
notifyWhenRunCompletes
setting was not given a chance to load before saving off the value in a Vueref
. The HTML expected the value to be an array and the backend was trying to default the value to['failed']
, but it would end upnull
in this case. If the user attempted to click one of the checkboxes to set the value, then the code would cause the value to get set as a booleantrue
instead of an array of strings. Finally, if a notification attempted to be fired, or the app was closed and opened again, code that expected the value fornotifyWhenRunCompletes
to be an array would cause the app to crash.The fix was to reactively set the value for
notifyWhenRunCompletes
in theNotifcationSettings
component once it had loaded when navigating from the top banner. Also, a fix was added toLocalSettingsActions.refreshLocalSettings()
to make sure to fix this preference value if it was set to aboolean
.Steps to test
Reproduce the original issue
develop
branch, open thestate.json
file under~/Library/Application Support/Cypress/cy/production/projects/__global__
and remove the following values:desktopNotificationsEnabled
notifyWhenRunCompletes
notifyWhenRunStartsFailing
notifyWhenRunStarts
state.json
file from above and notice that thenotifyWhenRunCompletes
value will betrue
Before fix
Screen.Recording.2023-07-07.at.2.17.49.PM.mov
Testing fix to repair bad value
state.json
file from above and notice that thenotifyWhenRunCompletes
value will be an array of stringsstate.json
fileTesting new code without existing settings
state.json
file under~/Library/Application Support/Cypress/cy/production/projects/__global__
and remove the same values as listed abovefailed
checked as the defaultstate.json
fileAfter fix
Screen.Recording.2023-07-07.at.2.08.25.PM.mov
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?