Skip to content
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

Clean up fundraising config calls #4846

Merged
merged 6 commits into from May 15, 2024
Merged

Conversation

tonisevener
Copy link
Collaborator

Phabricator: https://phabricator.wikimedia.org/T354575

Notes

This PR moves the API calls for the native form data (donate config and payment methods) from the Explore feed announcements content source to shortly before action sheet presentation. This should reduce the number of unnecessary API calls for most users, so that only those that intend to donate will make the call. This should also reduce the likelihood that we will hit the payment methods rate limit as we're testing.

I am also caching the responses for both calls for seven days, to match Android's implementation. We will lean on this cache if there is any issue with fetching.

Since there will now be a slight delay while we fetch the data, I also added a spinner in the Settings table view cell and the campaign modal donate button.

Test Steps

  1. Set device region to Japan, and device date to May 30, 2024. Set device language to English or Japanese. Add credit card to Apple Wallet.
  2. Fresh install app.
  3. After launch, background and foreground, then pull to refresh on Explore feed to fetch the announcements.
  4. Tap into an article.
  5. Campaign modal should appear. Tap "Donate now". You should see a quick spinner. If you have not hit the payment methods rate limit yet, you should see the action sheet asking for which payment method. Choose Apple Pay and confirm you are navigated to Apple Pay form. If you have hit the rate limit, you will be navigated directly to the in-app web view.
  6. Go to Settings. Tap "Donate". Again, you should see a quick spinner, then an action sheet (if not rate limited) or navigated directly to the web view.

@mazevedofs mazevedofs merged commit 81a4811 into main May 15, 2024
4 checks passed
@mazevedofs mazevedofs deleted the fundraising-cleanup-config-calls branch May 15, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants