-
Notifications
You must be signed in to change notification settings - Fork 120
[Just In Time Messages] Refresh JITMs #8012
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
Conversation
Syncing announcements after the webview is closed will allow the JITM to be automatically removed in response to user action, if the user no longer fits the profile to recieve the message after they have taken the action in the webview.
|
@rachelmcr optional review again. FYI I moved the code that prevents JITM sync when there's a product announcement showing, because it was stopping us from clearing the JITMs on refresh, if the user had become ineligible for the message. Let me know if you have any concerns but it has the same effect on priority of announcements. |
You can test the changes from this Pull Request by:
|
Syncing announcements after the webview is closed will allow the JITM to be automatically removed in response to user action, if the user no longer fits the profile to recieve the message after they have taken the action in the webview.
Generated by 🚫 dangerJS |
|
Thanks, these changes make sense! No issues from the products onboarding perspective 👍 |
koke
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 tested the first part and it worked fine. However, when I tap on the CTA and then dismiss the web view, the JITM is still there
Thanks for the speedy review @koke!
Yes, this is expected with this JITM. Ideally, if you tapped on the CTA, and bought a card reader, the JITM would be removed on refresh when you dismiss the webview. However, even if you do that it won't actually be dismissed with this test JITM: there's no targeting rule for "hasn't bought a card reader on woocommerce.com" at the moment. The code here merely gives us the ability to remove the JITM after some backend changes:
|
koke
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 was confused by the 6. Observe that the JITMs are dismissed. If this is the expected behavior then it's good to go 🚀
Ah sorry that is confusing. I missed out the step in those testing instructions where you should edit the response to Adding that in now to avoid confusing @pachlava as well 😬 |
Part of: #7916
Description
JITMs were previously only loaded when the Dashboard was first loaded. This could mean that the latest message is not shown, especially if the app has stayed in memory for some time.
The dashboard has data which benefits from regular refreshing, so in this PR we refresh the JITMs whenever that data is refreshed.
Additionally, when the user takes action in a webview, they may make themselves ineligible for a JITM, by completing the action it's informing them of. This PR resyncs the announcements when the webview is closed, so that JITMs will be automatically dismissed in that case
Testing instructions
N.B. see pdfdoF-1uc-p2#comment-2581 for details of setting up your store to be eligible for the test JITM
With a US store that is eligible for the test JITM, on a debug/alpha build of the app
Pull to refresh:
https://public-api.wordpress.com/rest/v1.1/jetpack-blogs/{SITEID}/rest-api/?json=true&path=/jetpack/v4/jitm%26_method%3Dget&query=%7B%22message_path%22%3A%22woomobile%3Amy_store%3Aadmin_notices%22%7D{data: []}as the response)Refresh after webview dismissal
https://public-api.wordpress.com/rest/v1.1/jetpack-blogs/*/rest-api/?json=true&path=/jetpack/v4/jitm*Doneor swipe the webview away{"data": []}N.B. there's nothing you can do in this webview to become ineligible for the JITM, which is the expected use case. With potential future backend changes, e.g. to target only people who've not bought a card reader, this refresh behaviour could automatically remove a JITM without need for them to dismiss it.
Screenshots
jitm-refresh-on-webview-close.mp4
RELEASE-NOTES.txtif necessary.