-
Notifications
You must be signed in to change notification settings - Fork 293
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
Implement RRM maybeSyncPublicationOnboardingState()
action
#8797
Comments
Thank you for the IB, @ankitrox ! Please take a look at my comments below:
Let's also wait for
It would also be beneficial to mention that this should also run if Please let me know if you have any questions, thank you! |
Thank you @nfmohit . I have updated the couple of points mentioned in the feedback. |
Thank you @ankitrox ! I have made some small improvements to the IB, namely:
The IB LGTM 👍 ✅ |
@kuasha420 has addressed this correctly in his PR but I just wanted to note how we should not be introducing any module-specific effects/coupling into core components like |
QA Update
|
Hi @kelvinballoo, I just tested develop and the endpoint is correct and is getting hit. Can you try again? I'm not sure why it didn't work for you, maybe the zip on develop didn't update correctly. |
QA Update
|
Hi @kelvinballoo Sorry for the confusion. The timestamp is stored as |
QA Update
|
QA Update ❌Hi @kuasha420 , as per our sync, I'm always getting the Assigning to you for investigation. |
@kelvinballoo Moving this back to QA now that #9163 has been merged, as @kuasha420 mentioned that it should address the issue here #9163 (review) |
QA Update ✅Tested this and it's looking good now.
|
Feature Description
The
maybeSyncPublicationOnboardingState()
action should be implemented for the Reader Revenue Manager module that periodically dispatches thesyncPublicationOnboardingState()
action (once every hour) to sync the value of thepublicationOnboardingState
module setting.maybeSyncPublicationOnboardingState()
action should be dispatched in the Site Kit dashboard on load, similar to how it is done forsyncGoogleTagSettings()
.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
maybeSyncPublicationOnboardingState()
action should be implemented for themodules/reader-revenue-manager
data store.publicationOnboardingStateLastSyncedAtMs
module setting and determine if it has been more than an hour since the last sync. If so, thesyncPublicationOnboardingState()
action should be dispatched.maybeSyncPublicationOnboardingState()
action should be dispatched in the Site Kit dashboard on load, similar to how it is done forsyncGoogleTagSettings()
.Implementation Brief
assets/js/components/DashboardEntryPoint.js
, collect actions object of RRM module usinguseDispatch
rrmActions?.maybeSyncPublicationOnboardingState()
insideuseMount
hook.maybeSyncPublicationOnboardingState
insideassets/js/module/reader-revenue-manager/datastore/publications.js
getModules
to resolved.null
if module is not connected.getSettings
selector on module and wait for it to be resolved so that settings are available before we make another check. Refer this for similar approach.getPublicationOnboardingStateLastSyncedAtMs
selector on module. If the value is present and an hour has not passed since last sync, return from the action and do nothing. Refer here.syncPublicationOnboardingState
which would update the settings on server as well as in the local state for the module based on following.getPublicationOnboardingStateLastSyncedAtMs
is zero.Test Coverage
Add tests for
maybeSyncPublicationOnboardingState
action with different values forpublicationOnboardingStateLastSyncedAtMs
setting.QA Brief
ONBOARDING_STATE_UNSPECIFIED
andpublicationOnboardingStateLastSyncedAtMs
is zero. This can be verified by usinggooglesitekit.data.select('modules/reader-revenue-manager').getSettings()
.GET:modules/reader-revenue-manager/data/publications
and thepublicationOnboardingStateLastSyncedAtMs
should be updated. Use the above snippet to verify the timestamp.Changelog entry
The text was updated successfully, but these errors were encountered: