-
Notifications
You must be signed in to change notification settings - Fork 295
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
Enhancement/9285 internal server error refactor #10100
base: develop
Are you sure you want to change the base?
Conversation
Build files for d73e742 are ready:
|
Size Change: -555 B (-0.03%) Total Size: 1.99 MB
ℹ️ View Unchanged
|
JS tests are flaky, nothing related to 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.
Hey @zutigrm, thanks for this PR! I've added a couple of comments. But also, when I follow the QAB, the notification doesn't appear automatically, like it does on the develop
branch. I've had to run await googlesitekit.data.select('core/notifications').getQueuedNotifications('settings');
in the console for the error to appear on the Settings page after making a request with a 500 error. I used tweak and followed your QAB exactly.
I think we are again having a use case where we need to have an 'ad hoc' notification added to the queue.
InternalServerError.mov
@@ -24,14 +24,12 @@ import { Fragment } from '@wordpress/element'; | |||
/** | |||
* Internal dependencies | |||
*/ | |||
import InternalServerError from './InternalServerError'; | |||
import Notifications from './Notifications'; | |||
import { NOTIFICATION_AREAS } from '../../googlesitekit/notifications/datastore/constants'; | |||
|
|||
export default function ErrorNotifications() { | |||
return ( | |||
<Fragment> |
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 need for the <Fragment>
now.
// The activateModule() action which is used to forward the errors | ||
// to the `internalServerError` state value uses internally | ||
// getAuthentication() resolver. | ||
await resolveSelect( CORE_USER ).getAuthentication(); |
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.
The activateModule
action which eventually does setModuleActivation
action calls REFETCH_AUTHENTICATION
only on success. So I don't think this will make any difference here. Am I missing something here?
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.
Indeed, it slipped my mind that this notification is shown on failure, so this won't be needed
…nternal-server-error-refactor.
Summary
Addresses issue:
Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist