Backend-driven Dynamic Cards filtering - #22320
Conversation
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr22320-0b27182 | |
| Version | 24.0 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 0b27182 | |
| App Center Build | WPiOS - One-Offs #8377 |
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr22320-0b27182 | |
| Version | 24.0 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 0b27182 | |
| App Center Build | jetpack-installable-builds #7399 |
hassaanelgarem
left a comment
There was a problem hiding this comment.
Tested against the sandbox and it works as expected 🚀
Sandbox your emulator with D133371-code (instructions paqN3M-5m-p2)
FYI: the instructions linked here only applied to Android. For iOS, I was able to test by simply sandboxing public-api.wordpress.com on my mac and running a simulator.
| # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: '32b5a9fdd097b82934a5ce679c915a1fc3f21848' | ||
| pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: 'task/22315-backend-driven-dynamic-cards-filtering' |
There was a problem hiding this comment.
I had to do this to get the rake dependencies to succeed:
| # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: '32b5a9fdd097b82934a5ce679c915a1fc3f21848' | |
| pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: 'task/22315-backend-driven-dynamic-cards-filtering' | |
| pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: 'accfc22fada868a8b44247acaf15c9edb403ca43' | |
| # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: '' |
alpavanoglu
left a comment
There was a problem hiding this comment.
Code looks good. I did not test since Hassaan has already approved. LMK if you prefer that I test as well.
| }() | ||
|
|
||
| /// The `deviceID` ensures we retain a stable set of Feature Flags between updates. If there are staged rollouts or other dynamic changes | ||
| /// happening server-side we don't want out flags to change on each fetch, so we provide an anonymous ID to manage this. |
There was a problem hiding this comment.
typo: "out flags" -> "our flags" I suppose?
But I think you've only moved this code.
There was a problem hiding this comment.
But I think you've only moved this code.
Correct, but I'll fix the typo.
|
Hey @salimbraksa 👋 |
|
Hey @salimbraksa 👋 You might notice a merge Don't hesitate to ping me if there's any trouble. |
8abe2f6 to
89c4de9
Compare
|
Hey @mokagio, I've switched the base branch to |
|
Hey @salimbraksa 👋 I'm always happy to help 👍 wordpress-mobile/WordPressKit-iOS#674 introduced a breaking change. That's okay, but as I mentioned is something that adds extra release overhead because WordPressAuthenticator depends on WordPressKit. If we bump the major version of Kit, we also need to release a new version of Authenticator. That's not a big deal, but given the additional effort, we try to minimize breaking changes and use the occasion when we have to ship one as a chance to batch in others. Is there any way the work from wordpress-mobile/WordPressKit-iOS#674 could be updated so that it's backward compatible? For example. The current diff goes: open func fetch(
cards: [String],
forBlogID blogID: Int,
+ deviceId: String,
success: @escaping (NSDictionary) -> Void,
failure: @escaping (Error) -> Void
) {Could we do something like open func fetch(
cards: [String],
forBlogID blogID: Int,
deviceId: String? = nil,
success: @escaping (NSDictionary) -> Void,
failure: @escaping (Error) -> Void
) {
guard let deviceId else {
// A deviceId value must be provided, we allow it to be nil only to avoid breaking API compatibility.
failure(NSError(domain: "DashboardServiceRemote", code: 1, userInfo: nil))Admittedly, it's not an elegant solution and it leaves the door open for future misuses, but it does allow us to be more intentional with breaking changes. What do you think? |
|
@salimbraksa thank you for quickly addressing my suggestion via wordpress-mobile/WordPressKit-iOS#676 – And love that there was a test for that path, too. I'll take it from here to release the new WordPressKit and integrate — seems only fair 😄 |
|
Taking over merging to ship a new build. |
The parameter was [initially designed to be non-optional][PR-1]. Later it's later [changed to be optional][PR-2], under [this proposal][comment-1]. This commit simply reverts the parameter to be non-optional, to ship it along with other breaking changes. [PR-1]: #674 [PR-2]: #676 [comment-1]: wordpress-mobile/WordPress-iOS#22320 (comment)


Fixes #22315
Related PR
Descrption
This PR calls the updates dashboard cards endpoint passing the extra parameters (device_id, platform, build_number, marketing_version, identifier) and removes the local dynamic cards filtering logic that was based on the deleted
remote_feature_flagresponse field.Test Instructions
FeatureFlagRemote.swiftfile.self.marketingVersionto23.9.FeatureFlagRemote.swiftfile.self.marketingVersionto24.0.Note
Please remove the
Do Not Mergelabel and merge after:WordPressKitpod on this PR is updated to point totrunk.Regression Notes
Potential unintended areas of impact
New params are passed to the
Dashboard Cardsendpoint, this API change could unintentionally return incorrect cards. So, the content of the following cards should be tested:What I did to test those areas of impact (or what existing automated tests I relied on)
Manual testing.
What automated tests I added (or what prevented me from doing so)
None.
PR submission checklist:
RELEASE-NOTES.txtif necessary.