Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

Part of #8544

Description

This PR migrates the leaderboards endpoint to enable REST API. Changes include:

  • Updated LeaderboardsListMapper to parse contents without the data envelope
  • Enabled REST API for the loadLeaderboards request.

Testing instructions

  • In DefaultFeatureFlagService, enable the flag for applicationPasswordAuthenticationForSiteCredentialLogin and build the app.
  • Log out of the app or skip onboarding if needed.
  • On the prologue screen, select "Enter your site address".
  • Enter your test store address and tap "Continue".
  • Enter the correct site credentials for your account in the test store.
  • After the login succeeds, you should be navigated to the home screen.
  • In Xcode console log, notice the event 🔵 Tracked dashboard_top_performers_loaded. This means top performers have been loaded successfully.

Please feel free to test again by logging in with a WPCom account. The top performer fetch should still succeed.

Screenshots

N/A


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@itsmeichigo itsmeichigo added type: task An internally driven task. feature: stats Related to stats, including Top Performers. status: feature-flagged Behind a feature flag. Milestone is not strongly held. labels Jan 4, 2023
@itsmeichigo itsmeichigo added this to the 11.8 milestone Jan 4, 2023
@peril-woocommerce
Copy link

Warnings
⚠️ This PR is assigned to a milestone which is closing in less than 2 days Please, make sure to get it merged by then or assign it to a later expiring milestone

Generated by 🚫 dangerJS

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 4, 2023

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8546-c76f163 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@jaclync jaclync self-assigned this Jan 5, 2023
Copy link
Contributor

@jaclync jaclync left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just had a question about whether we support leaderboard stats WC versions under 6.7 - I tried a JN site with WC version 6.3 using the WooCommerce Beta Tester plugin, and the leaderboard API request had a 404 error.

siteID: siteID,
path: Constants.path,
parameters: parameters,
availableAsRESTRequest: true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reasons we don't allow availableAsRESTRequest: true for the deprecated leaderboards request loadLeaderboardsDeprecated below for sites with WC version under 6.7? is it because application passwords are supported for higher WC version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching - I missed this 😅 Application password only has requirement for WordPress 5.6 minimum, so we should support WC under 6.7 I believe. Updated in c76f163.

@itsmeichigo itsmeichigo enabled auto-merge January 5, 2023 02:26
@itsmeichigo itsmeichigo merged commit c07fa39 into trunk Jan 5, 2023
@itsmeichigo itsmeichigo deleted the feat/8544-migrate-leaderboard branch January 5, 2023 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: stats Related to stats, including Top Performers. status: feature-flagged Behind a feature flag. Milestone is not strongly held. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants