You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to add a storeName argument to createErrorStore, and also add this argument to every current call to createErrorStore we make. This way, all errors will be able to return the storeName used.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
createErrorStore should take a new argument: storeName. It should be required argument unless there's a clear reason why it can't be for some code paths.
All existing calls to createErrorStore should be updated to use this argument, supplying the storeName they're associated with.
The store name of the error store should be saved in state so selectors for this error store can use it. (It will be made available to all errors returned by getErrorForSelector, see: Add new selectorData object in getErrorForSelector #5234, for now it just needs to accept the argument as a required argument.)
Implementation Brief
In assets/js/googlesitekit/data/create-error-store.js:
Add storeName (required) param.
Use invariant() method to validate if the storeName is passed.
Update the existing createErrorStore( storeName ) calls to pass the storename argument:
In assets/js/googlesitekit/datastore/forms/index.js, pass CORE_FORMS to createErrorStore( CORE_FORMS ).
In assets/js/googlesitekit/datastore/site/index.js, pass CORE_SITE to createErrorStore( CORE_SITE ).
In assets/js/googlesitekit/datastore/ui/index.js, pass CORE_UI to createErrorStore( CORE_UI ).
In assets/js/googlesitekit/datastore/user/index.js, pass CORE_USER to createErrorStore( CORE_USER ).
In assets/js/googlesitekit/modules/datastore/index.js, pass CORE_MODULES to createErrorStore( CORE_MODULES ).
In assets/js/googlesitekit/widgets/datastore/index.js, pass CORE_WIDGETS to createErrorStore( CORE_WIDGETS ).
In assets/js/googlesitekit/modules/create-module-store.js, pass the storeName variable to all the instances of createErrorStore( storeName ).
In assets/js/googlesitekit/modules/create-submit-changes-store.test.js, pass the storeName variable to all the instances of createErrorStore( storeName ).
Test Coverage
Add test coverage for receiving the storeName argument
QA Brief
This only adds store names to errors, so the best way to QA this is to run through scenarios in many modules/parts of the plugin that would generate errors, like auth errors, network errors, permissions, etc. Errors should continue to appear as normal before this change.
Changelog entry
Require storeName parameter for createErrorStore function, to provide it as context for errors.
The text was updated successfully, but these errors were encountered:
Ran through scenarios in many modules/parts of the plugin that would generate errors, like auth errors, network errors, permissions, etc. Errors should continue to appear as normal before this change.
Feature Description
In order for #5234 to be implemented, each error store needs awareness of its
storeName
. See the design doc for more info: https://docs.google.com/document/d/1QIruz3fJSDQJ2cILtBHlU6ow8esyaVS3mcuaqt5QQR8/edit?resourcekey=0-nM2tn9DOjjHDWTtspbERkA#heading=h.xleqo0mvx6mvWe need to add a
storeName
argument tocreateErrorStore
, and also add this argument to every current call tocreateErrorStore
we make. This way, all errors will be able to return thestoreName
used.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
createErrorStore
should take a new argument:storeName
. It should be required argument unless there's a clear reason why it can't be for some code paths.createErrorStore
should be updated to use this argument, supplying thestoreName
they're associated with.getErrorForSelector
, see: Add new selectorData object in getErrorForSelector #5234, for now it just needs to accept the argument as a required argument.)Implementation Brief
assets/js/googlesitekit/data/create-error-store.js
:storeName
(required) param.invariant()
method to validate if thestoreName
is passed.Update the existing
createErrorStore( storeName )
calls to pass thestorename
argument:assets/js/googlesitekit/datastore/forms/index.js
, passCORE_FORMS
tocreateErrorStore( CORE_FORMS )
.assets/js/googlesitekit/datastore/site/index.js
, passCORE_SITE
tocreateErrorStore( CORE_SITE )
.assets/js/googlesitekit/datastore/ui/index.js
, passCORE_UI
tocreateErrorStore( CORE_UI )
.assets/js/googlesitekit/datastore/user/index.js
, passCORE_USER
tocreateErrorStore( CORE_USER )
.assets/js/googlesitekit/modules/datastore/index.js
, passCORE_MODULES
tocreateErrorStore( CORE_MODULES )
.assets/js/googlesitekit/widgets/datastore/index.js
, passCORE_WIDGETS
tocreateErrorStore( CORE_WIDGETS )
.assets/js/googlesitekit/modules/create-module-store.js
, pass thestoreName
variable to all the instances ofcreateErrorStore( storeName )
.assets/js/googlesitekit/modules/create-submit-changes-store.test.js
, pass thestoreName
variable to all the instances ofcreateErrorStore( storeName )
.Test Coverage
storeName
argumentQA Brief
Changelog entry
storeName
parameter forcreateErrorStore
function, to provide it as context for errors.The text was updated successfully, but these errors were encountered: