-
Notifications
You must be signed in to change notification settings - Fork 843
Forms: Prefix notification IDs to prevent conflicts #46065
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
base: trunk
Are you sure you want to change the base?
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCannot generate coverage summary while tests are failing. 🤐 Please fix the tests, or re-run the Code coverage job if it was something being flaky. |
simison
left a comment
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.
I didn't test-run but the code looks good.
This didn't fix the bug we were seeing but it's a good practise to prefix IDs Nonetheless.
|
BTW I noticed |
| .catch( () => { | ||
| createErrorNotice( __( 'Could not empty trash.', 'jetpack-forms' ), { | ||
| type: 'snackbar', | ||
| id: 'empty-trash-error', |
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 prefix here
| .catch( () => { | ||
| createErrorNotice( __( 'Could not empty spam.', 'jetpack-forms' ), { | ||
| type: 'snackbar', | ||
| id: 'empty-spam-error', |
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 prefix
| const numberOfErrors = promises.filter( ( { status } ) => status === 'rejected' ).length; | ||
| const errorMessage = getGenericErrorMessage( numberOfErrors ); | ||
|
|
||
| createErrorNotice( errorMessage, { type: 'snackbar' } ); |
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 ID at all 😅
Proposed changes:
jp-forms-to prevent conflicts with other plugins that may use generic notification IDs like 'empty-spam', 'empty-trash', etc.empty-spam→jp-forms-empty-spamempty-trash→jp-forms-empty-trashmark-as-spam-action→jp-forms-mark-as-spam-actionmark-as-not-spam-action→jp-forms-mark-as-not-spam-actionrestore-action→jp-forms-restore-actionmove-to-trash-action→jp-forms-move-to-trash-actionmove-to-trash-action→jp-forms-delete-action(also fixed incorrect ID)mark-as-read-action→jp-forms-mark-as-read-actionmark-as-unread-action→jp-forms-mark-as-unread-actionOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No
Testing instructions: