braintree_android icon indicating copy to clipboard operation
braintree_android copied to clipboard

[Fix Configuration Loader] Migrate Thread Scheduling Logic into BraintreeClient

Open sshropshire opened this issue 1 year ago • 3 comments

Note: This PR is Part 5 in a series of refactoring PRs to eliminate ConfigurationLoader race conditions. Previous PR: #1133 [Fix Configuration Loader] Prevent Race Condition

Summary of changes

  • This PR migrates multi-threading logic into BraintreeClient to set up an eventual easy migration to coroutines
  • In the future, we can leverage co-routines to reduce the SDK's responsibility to create background threads.
  • Upcoming Tasks to finish Fix Configuration Loader PR series:
    • Remove HttpClient and make all networking clients thread synchronous by default
    • Implement retry logic in ConfigurationLoader

Checklist

  • [ ] ~Added a changelog entry~
  • [x] Relevant test coverage

Authors

List GitHub usernames for everyone who contributed to this pull request.

  • @sshropshire

sshropshire avatar Sep 03 '24 16:09 sshropshire

@tdchow is this PR and the PRs in the base branch something we still need to get into v5? It's been inactive for a bit so wasn't sure if this still needed another 👍 and for us to open a PR from base to main.

jaxdesmarais avatar Oct 03 '24 18:10 jaxdesmarais

@tdchow is this PR and the PRs in the base branch something we still need to get into v5? It's been inactive for a bit so wasn't sure if this still needed another 👍 and for us to open a PR from base to main.

@sshropshire is this part 5 the final changes needed for the configuration loader refactor? would we be good merging the feature branch into main after this PR?

tdchow avatar Oct 03 '24 19:10 tdchow

It's definitely close. There's retry logic that needs to be re-implemented for this to be fully complete. It used to happen in HttpClient but it makes more sense for it to live in ConfigurationLoader.

sshropshire avatar Oct 07 '24 14:10 sshropshire

@sshropshire @tdchow what state is this PR in? Does it need more work or are we good to merge?

saperi22 avatar Nov 05 '24 19:11 saperi22

@saperi22 - We decided to put the ConfigurationLoader work on hold for now. I'll go ahead and close this PR.

tdchow avatar Nov 07 '24 15:11 tdchow