Re-check `registerDefaults` of the notification API if there is any resolver that needs to be resolved
Feature Description
Go over the assets/js/googlesitekit/notifications/register-defaults.js and check if there are resolvers, or selectors that are using different resolvers (like in the case of hasZeroData) in checkRequirements that might be missed, and are retrieved using select instead of resolveSelect. One such example is isModuleConnected which is currently not resolved. There might be more
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- All the data used in
checkRequirementsproperty of currently registered notifications should be properly resolved where needed - specifically when retrieving the data from resolvers.- One such example is
isModuleConnectedwhich is currently not resolved
- One such example is
Implementation Brief
- [x] Update
assets/js/googlesitekit/notifications/register-defaults.js- Data from
isModuleConnectedresolver should be retrieved withresolveSelectand awaited - There are few selectors, which rely on data from different resolver, which can't guarantee having data available at the point when notifications API is invoked, although there is good chance this data is already resolved and available due to requests for this mandatory data is done very early.
isAuthenticatedandgetUnsatisfiedScopesselectors are both usinggetAuthenticationresolver, which fetches the needed data.canViewSharedModuleselector, is relying on having data fromgetModuleresolver.- Invoke these dependency resolvers and await them before the selectors are called, to ensure data is resolved properly
- Data from
- Check if there is any other resolver that might be missed, in case new notifications are added after this IB has been written.
Test Coverage
- No updates are needed
QA Brief
- The following notifications need to be re-tested:
- Gathering Data
- Zero Data
- UnsatisfiedScopesAlert
- UnsatisfiedScopesAlertGTE
- GA4AdSenseLinked
Changelog entry
- Update requirement checks for notifications to have all selectors resolved correctly and efficiently.
AC ✔️
IB ✔️
QA Update ✅
- Tested on dev environment.
- Verified that the following notifications showing correctly and associated events getting trigger successfully.
- Gathering Data
- Zero Data
- UnsatisfiedScopesAlert
- UnsatisfiedScopesAlertGTE
- GA4AdSenseLinked
Zero and Gathering data state notifications
SC is in zero data state
Analytics is in gathering state but SC is in zero state
AC and Analytics both in zero data state
SC and analytics both in gathering data state
Both SC and analytics is in zero data state
SC is in gathering data state and Analytics is in zero data state
UnsatisfiedScopeAlert
UnsatisfiedScopeAlertGTE
GA4AdSenseLinked