-
Notifications
You must be signed in to change notification settings - Fork 121
[Just In Time Messages] Add build and locale identifiers to JITM request #8017
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
[Just In Time Messages] Add build and locale identifiers to JITM request #8017
Conversation
Release notes added, feature flag set to true.
You can test the changes from this Pull Request by:
|
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.
Works as expected and code looks good. However the last few commits seem more related to the JITM public release than the description of this PR. Are these actually intended for this branch?
| return buildConfig == .localDeveloper || buildConfig == .alpha | ||
| case .justInTimeMessagesOnDashboard: | ||
| return buildConfig == .localDeveloper || buildConfig == .alpha | ||
| return true |
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.
Was this meant to go in 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.
Yep, that's intentional, this is the last bit required for the release of i1. I've checked that it works correctly on a release build.
Should have called it out in the description, sorry!
@koke thanks again for the review! |
pachlava
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've checked that build and locale identifiers now show up for iPhone:
And that they change for iPad / other locale:
One small question: is it correct that when the app is not localized for the device locale in use (e.g. Ukrainian), the value still stays en_US?
Generated by 🚫 dangerJS |
|
@pachlava thanks as always for the review and detailed testing!
I'd not tested this case, but if that's the behaviour it makes sense for our use case. If the reverse were to happen, we would have a localised message in an otherwise unlocalised app, which would seem pretty strange. I didn't code that deliberately: I use |
This adds a workaround for an apparent backend bug: only the first query item is used in the `with_query_string` rule. For that reason, we send `build_type` first, followed by `platform`, followed by alphabetical order.
|
During testing with the new JITM testing definitions, I noticed that the display of JITMs had become inconsistent. Sometimes they showed up, sometimes they didn't. This was because the In the meantime, I've added a workaround in 0ac84df, by sorting the query params with |


Closes: #8015
Description
In Project Salas, we've added the ability to send Just In Time Messages to all Woo Mobile users, initially displayed on the dashboard. A single message definition will be picked up both on iOS and Android. There are also cases when we want to send a message to a smaller subset of our users, or define test JITMs which are not yet ready for production. The
with_query_stringandwithout_query_stringJITM rules can help here, but only if we pass useful data in the query.JITM Query
To take advantage of these rules, this PR adds the following to the GET
/jetpack/v4/jitmrequest, in thequerypart of thequeryobject, which is passed to the JITM engine:platform=iosversion=11.1build_type=developerforlocalDeveloperand CI builds. N.B. we don't include this parameter on alpha/beta/production builds.device=phoneorpadLocale
There is undocumented support for a
localequery parameter (top level) on our API. This is not supported in the JITM endpoints at present, but passing it now will allow us to support locale mismatch between the site and phone in future. At present, all JITMs will be localised to the site or user's default language.locale=en_USor other phone locale code. This deliberately excludes any currency or other locale identifier information.See pdfdoF-1Fe-p2 for full context.
Testing instructions
Configure Proxyman/Charles to view your network traffic, or use the WormHoly tools in the settings menu to view the requests later.
/jetpack/v4/jitmlocaleparameter with your phone's locale as the value, at the top level of the request –1in screenshot belowqueryparameter, with a JSON object, with an internalquerykey.platform,version,build_type, anddevicevalues as specified above –2in screenshot below.N.B. the values for these parameters, including locale, are not currently used for anything by the backend.
Screenshots
RELEASE-NOTES.txtif necessary.