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

Always recreate loadingPromise when calling retryLoading #863

Merged
merged 4 commits into from
Dec 18, 2017

Conversation

bg-stripe
Copy link
Contributor

r? @danj-stripe

Calling retryLoading currently does nothing if the promise has been completed with a value. The method was initially intended for use when PaymentContext's initial load fails, but you would also expect it to be useful for triggering a refresh of the stored customer object:

customerContext.clearCachedCustomer()
paymentContext.retryLoading()
paymentContext.presentPaymentMethodsViewController()

I can't think of any unintended side effects from this change. The method is only called once internally, in the STPPaymentContext initialization path. Apps that use this method to recover from initial loading errors won't be affected by the change.

@bg-stripe
Copy link
Contributor Author

note from IRL discussion: I'll update this so that retryLoading also clears the cached customer on CustomerContext

Copy link
Contributor

@danj-stripe danj-stripe left a comment

Choose a reason for hiding this comment

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

Looks great!

@bg-stripe bg-stripe merged commit f07bc03 into master Dec 18, 2017
@bg-stripe bg-stripe deleted the bg-clearcachedcustomer branch December 18, 2017 16:40
mludowise-stripe pushed a commit that referenced this pull request Mar 24, 2022
Adds a temporary webview for bug bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants